mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into OrganRefactor
This commit is contained in:
@@ -234,6 +234,7 @@
|
||||
var/emag = "securecrateemag"
|
||||
var/broken = 0
|
||||
var/locked = 1
|
||||
health = 1000
|
||||
|
||||
/obj/structure/closet/crate/secure/update_icon()
|
||||
..()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
name = "wall"
|
||||
desc = "A huge chunk of metal used to seperate rooms."
|
||||
anchored = 1
|
||||
icon = 'icons/turf/walls.dmi'
|
||||
icon = 'icons/turf/walls/wall.dmi'
|
||||
var/mineral = "metal"
|
||||
var/walltype = "metal"
|
||||
var/opening = 0
|
||||
@@ -19,36 +19,12 @@
|
||||
|
||||
canSmoothWith = list(
|
||||
/turf/simulated/wall,
|
||||
/turf/simulated/wall/r_wall,
|
||||
/obj/structure/falsewall,
|
||||
/obj/structure/falsewall/reinforced // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS.
|
||||
)
|
||||
|
||||
/obj/structure/falsewall/New()
|
||||
..()
|
||||
relativewall_neighbours()
|
||||
|
||||
/obj/structure/falsewall/Destroy()
|
||||
|
||||
var/temploc = loc
|
||||
loc = null
|
||||
|
||||
for(var/turf/simulated/wall/W in range(temploc,1))
|
||||
W.relativewall()
|
||||
|
||||
for(var/obj/structure/falsewall/W in range(temploc,1))
|
||||
W.relativewall()
|
||||
return ..()
|
||||
|
||||
/obj/structure/falsewall/relativewall()
|
||||
|
||||
if(!density)
|
||||
icon_state = "[walltype]fwall_open"
|
||||
return
|
||||
|
||||
var/junction = findSmoothingNeighbors()
|
||||
icon_state = "[walltype][junction]"
|
||||
return
|
||||
|
||||
/obj/structure/falsewall/reinforced, // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS. //because we do smooth with real r-walls now
|
||||
/turf/simulated/wall/rust,
|
||||
/turf/simulated/wall/r_wall/rust)
|
||||
smooth = SMOOTH_TRUE
|
||||
|
||||
/obj/structure/falsewall/attack_hand(mob/user)
|
||||
if(opening)
|
||||
@@ -75,17 +51,19 @@
|
||||
|
||||
/obj/structure/falsewall/proc/do_the_flick()
|
||||
if(density)
|
||||
flick("[walltype]fwall_opening", src)
|
||||
smooth = SMOOTH_FALSE
|
||||
clear_smooth_overlays()
|
||||
icon_state = "fwall_opening"
|
||||
else
|
||||
flick("[walltype]fwall_closing", src)
|
||||
icon_state = "fwall_closing"
|
||||
|
||||
/obj/structure/falsewall/update_icon(relativewall = 1)//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
|
||||
/obj/structure/falsewall/update_icon()
|
||||
if(density)
|
||||
icon_state = "[walltype]0"
|
||||
if(relativewall)
|
||||
relativewall()
|
||||
smooth = SMOOTH_TRUE
|
||||
smooth_icon(src)
|
||||
icon_state = ""
|
||||
else
|
||||
icon_state = "[walltype]fwall_open"
|
||||
icon_state = "fwall_open"
|
||||
|
||||
/obj/structure/falsewall/proc/ChangeToWall(delete = 1)
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -147,6 +125,7 @@
|
||||
/obj/structure/falsewall/reinforced
|
||||
name = "reinforced wall"
|
||||
desc = "A huge chunk of reinforced metal used to seperate rooms."
|
||||
icon = 'icons/turf/walls/reinforced_wall.dmi'
|
||||
icon_state = "r_wall"
|
||||
walltype = "rwall"
|
||||
|
||||
@@ -164,11 +143,13 @@
|
||||
/obj/structure/falsewall/uranium
|
||||
name = "uranium wall"
|
||||
desc = "A wall with uranium plating. This is probably a bad idea."
|
||||
icon = 'icons/turf/walls/uranium_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "uranium"
|
||||
walltype = "uranium"
|
||||
var/active = null
|
||||
var/last_event = 0
|
||||
canSmoothWith = list(/obj/structure/falsewall/uranium, /turf/simulated/wall/mineral/uranium)
|
||||
|
||||
/obj/structure/falsewall/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
radiate()
|
||||
@@ -197,30 +178,39 @@
|
||||
/obj/structure/falsewall/gold
|
||||
name = "gold wall"
|
||||
desc = "A wall with gold plating. Swag!"
|
||||
icon = 'icons/turf/walls/gold_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "gold"
|
||||
walltype = "gold"
|
||||
canSmoothWith = list(/obj/structure/falsewall/gold, /turf/simulated/wall/mineral/gold)
|
||||
|
||||
/obj/structure/falsewall/silver
|
||||
name = "silver wall"
|
||||
desc = "A wall with silver plating. Shiny."
|
||||
icon = 'icons/turf/walls/silver_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "silver"
|
||||
walltype = "silver"
|
||||
canSmoothWith = list(/obj/structure/falsewall/silver, /turf/simulated/wall/mineral/silver)
|
||||
|
||||
/obj/structure/falsewall/diamond
|
||||
name = "diamond wall"
|
||||
desc = "A wall with diamond plating. You monster."
|
||||
icon = 'icons/turf/walls/diamond_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "diamond"
|
||||
walltype = "diamond"
|
||||
canSmoothWith = list(/obj/structure/falsewall/diamond, /turf/simulated/wall/mineral/diamond)
|
||||
|
||||
|
||||
/obj/structure/falsewall/plasma
|
||||
name = "plasma wall"
|
||||
desc = "A wall with plasma plating. This is definately a bad idea."
|
||||
icon = 'icons/turf/walls/plasma_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "plasma"
|
||||
walltype = "plasma"
|
||||
canSmoothWith = list(/obj/structure/falsewall/plasma, /turf/simulated/wall/mineral/plasma, /turf/simulated/wall/mineral/alien)
|
||||
|
||||
/obj/structure/falsewall/plasma/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(is_hot(W) > 300)
|
||||
@@ -240,13 +230,24 @@
|
||||
if(exposed_temperature > 300)
|
||||
burnbabyburn()
|
||||
|
||||
//-----------wtf?-----------start
|
||||
/obj/structure/falsewall/alien
|
||||
name = "alien wall"
|
||||
desc = "A strange-looking alien wall."
|
||||
icon = 'icons/turf/walls/plasma_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "alien"
|
||||
walltype = "alien"
|
||||
canSmoothWith = list(/obj/structure/falsewall/alien, /turf/simulated/wall/mineral/alien)
|
||||
|
||||
|
||||
/obj/structure/falsewall/clown
|
||||
name = "bananium wall"
|
||||
desc = "A wall with bananium plating. Honk!"
|
||||
icon = 'icons/turf/walls/bananium_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "clown"
|
||||
walltype = "clown"
|
||||
canSmoothWith = list(/obj/structure/falsewall/clown, /turf/simulated/wall/mineral/clown)
|
||||
|
||||
/obj/structure/falsewall/sandstone
|
||||
name = "sandstone wall"
|
||||
@@ -254,4 +255,22 @@
|
||||
icon_state = ""
|
||||
mineral = "sandstone"
|
||||
walltype = "sandstone"
|
||||
//------------wtf?------------end
|
||||
canSmoothWith = list(/obj/structure/falsewall/sandstone, /turf/simulated/wall/mineral/sandstone)
|
||||
|
||||
/obj/structure/falsewall/wood
|
||||
name = "wooden wall"
|
||||
desc = "A wall with wooden plating. Stiff."
|
||||
icon = 'icons/turf/walls/wood_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "wood"
|
||||
walltype = "wood"
|
||||
canSmoothWith = list(/obj/structure/falsewall/wood, /turf/simulated/wall/mineral/wood)
|
||||
|
||||
/obj/structure/falsewall/iron
|
||||
name = "rough metal wall"
|
||||
desc = "A wall with rough metal plating."
|
||||
icon = 'icons/turf/walls/iron_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "metal"
|
||||
walltype = "iron"
|
||||
canSmoothWith = list(/obj/structure/falsewall/iron, /turf/simulated/wall/mineral/iron)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/obj/structure/window/full
|
||||
sheets = 2
|
||||
dir=SOUTHWEST
|
||||
level = 3
|
||||
|
||||
/obj/structure/window/full/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
return 1
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
layer = 2.9
|
||||
var/health = 10
|
||||
var/destroyed = 0
|
||||
level = 3
|
||||
|
||||
|
||||
/obj/structure/grille/fence/
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
handle_rotation()
|
||||
if(istype(src.loc, /turf/simulated))
|
||||
var/turf/simulated/T = src.loc
|
||||
if(T.wet == 2) //Lube! Fall off!
|
||||
if(T.wet == TURF_WET_LUBE) //Lube! Fall off!
|
||||
playsound(src, 'sound/misc/slip.ogg', 50, 1, -3)
|
||||
buckled_mob.Stun(7)
|
||||
buckled_mob.Weaken(7)
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
/datum/song
|
||||
var/name = "Untitled"
|
||||
var/list/lines = new()
|
||||
var/tempo = 5 // delay between notes
|
||||
var/tempo = 5 // delay between notes
|
||||
|
||||
var/playing = 0 // if we're playing
|
||||
var/help = 0 // if help is open
|
||||
var/edit = 1 // if we're in editing mode
|
||||
var/repeat = 0 // number of times remaining to repeat
|
||||
var/max_repeats = 10 // maximum times we can repeat
|
||||
var/playing = 0 // if we're playing
|
||||
var/help = 0 // if help is open
|
||||
var/repeat = 0 // number of times remaining to repeat
|
||||
var/max_repeat = 10 // maximum times we can repeat
|
||||
|
||||
var/instrumentDir = "piano" // the folder with the sounds
|
||||
var/instrumentExt = "ogg" // the file extension
|
||||
@@ -63,9 +62,6 @@
|
||||
continue
|
||||
M.playsound_local(source, soundfile, 100, falloff = 5)
|
||||
|
||||
/datum/song/proc/updateDialog(mob/user as mob)
|
||||
instrumentObj.updateDialog() // assumes it's an object in world, override if otherwise
|
||||
|
||||
/datum/song/proc/shouldStopPlaying(mob/user)
|
||||
if(instrumentObj)
|
||||
//if(!user.canUseTopic(instrumentObj))
|
||||
@@ -113,68 +109,31 @@
|
||||
else
|
||||
sleep(tempo)
|
||||
repeat--
|
||||
if(repeat >= 0) // don't show the last -1 repeat
|
||||
updateDialog(user)
|
||||
playing = 0
|
||||
repeat = 0
|
||||
updateDialog(user)
|
||||
|
||||
/datum/song/proc/interact(mob/user as mob)
|
||||
var/dat = ""
|
||||
/datum/song/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
|
||||
if(lines.len > 0)
|
||||
dat += "<H3>Playback</H3>"
|
||||
if(!playing)
|
||||
dat += "<A href='?src=\ref[src];play=1'>Play</A> <SPAN CLASS='linkOn'>Stop</SPAN><BR><BR>"
|
||||
dat += "Repeat Song: "
|
||||
dat += repeat > 0 ? "<A href='?src=\ref[src];repeat=-10'>-</A><A href='?src=\ref[src];repeat=-1'>-</A>" : "<SPAN CLASS='linkOff'>-</SPAN><SPAN CLASS='linkOff'>-</SPAN>"
|
||||
dat += " [repeat] times "
|
||||
dat += repeat < max_repeats ? "<A href='?src=\ref[src];repeat=1'>+</A><A href='?src=\ref[src];repeat=10'>+</A>" : "<SPAN CLASS='linkOff'>+</SPAN><SPAN CLASS='linkOff'>+</SPAN>"
|
||||
dat += "<BR>"
|
||||
else
|
||||
dat += "<SPAN CLASS='linkOn'>Play</SPAN> <A href='?src=\ref[src];stop=1'>Stop</A><BR>"
|
||||
dat += "Repeats left: <B>[repeat]</B><BR>"
|
||||
if(!edit)
|
||||
dat += "<BR><B><A href='?src=\ref[src];edit=2'>Show Editor</A></B><BR>"
|
||||
else
|
||||
dat += "<H3>Editing</H3>"
|
||||
dat += "<B><A href='?src=\ref[src];edit=1'>Hide Editor</A></B>"
|
||||
dat += " <A href='?src=\ref[src];newsong=1'>Start a New Song</A>"
|
||||
dat += " <A href='?src=\ref[src];import=1'>Import a Song</A><BR><BR>"
|
||||
var/bpm = round(600 / tempo)
|
||||
dat += "Tempo: <A href='?src=\ref[src];tempo=[world.tick_lag]'>-</A> [bpm] BPM <A href='?src=\ref[src];tempo=-[world.tick_lag]'>+</A><BR><BR>"
|
||||
var/linecount = 0
|
||||
for(var/line in lines)
|
||||
linecount += 1
|
||||
dat += "Line [linecount]: <A href='?src=\ref[src];modifyline=[linecount]'>Edit</A> <A href='?src=\ref[src];deleteline=[linecount]'>X</A> [line]<BR>"
|
||||
dat += "<A href='?src=\ref[src];newline=1'>Add Line</A><BR><BR>"
|
||||
if(help)
|
||||
dat += "<B><A href='?src=\ref[src];help=1'>Hide Help</A></B><BR>"
|
||||
dat += {"
|
||||
Lines are a series of chords, separated by commas (,), each with notes seperated by hyphens (-).<br>
|
||||
Every note in a chord will play together, with chord timed by the tempo.<br>
|
||||
<br>
|
||||
Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.<br>
|
||||
By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.<br>
|
||||
Example: <i>C,D,E,F,G,A,B</i> will play a C major scale.<br>
|
||||
After a note has an accidental placed, it will be remembered: <i>C,C4,C,C3</i> is C3,C4,C4,C3</i><br>
|
||||
Chords can be played simply by seperating each note with a hyphon: <i>A-C#,Cn-E,E-G#,Gn-B</i><br>
|
||||
A pause may be denoted by an empty chord: <i>C,E,,C,G</i><br>
|
||||
To make a chord be a different time, end it with /x, where the chord length will be length<br>
|
||||
defined by tempo / x: <i>C,G/2,E/4</i><br>
|
||||
Combined, an example is: <i>E-E4/4,F#/2,G#/8,B/8,E3-E4/4</i>
|
||||
<br>
|
||||
Lines may be up to 50 characters.<br>
|
||||
A song may only contain up to 50 lines.<br>
|
||||
"}
|
||||
else
|
||||
dat += "<B><A href='?src=\ref[src];help=2'>Show Help</A></B><BR>"
|
||||
data["lines"] = lines
|
||||
data["tempo"] = tempo
|
||||
|
||||
var/datum/browser/popup = new(user, "instrument", instrumentObj.name, 700, 500)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(instrumentObj.icon, instrumentObj.icon_state))
|
||||
popup.open()
|
||||
data["playing"] = playing
|
||||
data["help"] = help
|
||||
data["repeat"] = repeat
|
||||
data["maxRepeat"] = max_repeat
|
||||
data["minTempo"] = world.tick_lag
|
||||
data["maxTempo"] = 600
|
||||
|
||||
if(!instrumentObj)
|
||||
return
|
||||
|
||||
ui = nanomanager.try_update_ui(user, instrumentObj, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, instrumentObj, ui_key, "song.tmpl", instrumentObj.name, 700, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/datum/song/Topic(href, href_list)
|
||||
if(!in_range(instrumentObj, usr) || (issilicon(usr) && instrumentObj.loc != usr) || !isliving(usr) || !usr.canmove || usr.restrained())
|
||||
@@ -185,14 +144,16 @@
|
||||
instrumentObj.add_fingerprint(usr)
|
||||
|
||||
if(href_list["newsong"])
|
||||
playing = 0
|
||||
lines = new()
|
||||
tempo = sanitize_tempo(5) // default 120 BPM
|
||||
name = ""
|
||||
|
||||
else if(href_list["import"])
|
||||
playing = 0
|
||||
var/t = ""
|
||||
do
|
||||
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
|
||||
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
|
||||
if(!in_range(instrumentObj, usr))
|
||||
return
|
||||
|
||||
@@ -220,13 +181,9 @@
|
||||
lines.Remove(l)
|
||||
else
|
||||
linenum++
|
||||
updateDialog(usr) // make sure updates when complete
|
||||
|
||||
else if(href_list["help"])
|
||||
help = text2num(href_list["help"]) - 1
|
||||
|
||||
else if(href_list["edit"])
|
||||
edit = text2num(href_list["edit"]) - 1
|
||||
help = !help
|
||||
|
||||
if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops.
|
||||
if(playing)
|
||||
@@ -234,18 +191,24 @@
|
||||
repeat += round(text2num(href_list["repeat"]))
|
||||
if(repeat < 0)
|
||||
repeat = 0
|
||||
if(repeat > max_repeats)
|
||||
repeat = max_repeats
|
||||
if(repeat > max_repeat)
|
||||
repeat = max_repeat
|
||||
|
||||
else if(href_list["tempo"])
|
||||
tempo = sanitize_tempo(tempo + text2num(href_list["tempo"]))
|
||||
tempo = sanitize_tempo(tempo + text2num(href_list["tempo"]) * world.tick_lag)
|
||||
|
||||
else if(href_list["play"])
|
||||
if(playing)
|
||||
return
|
||||
playing = 1
|
||||
spawn()
|
||||
playsong(usr)
|
||||
|
||||
else if(href_list["newline"])
|
||||
else if(href_list["insertline"])
|
||||
var/num = round(text2num(href_list["insertline"]))
|
||||
if(num < 1 || num > lines.len + 1)
|
||||
return
|
||||
|
||||
var/newline = html_encode(input("Enter your line: ", instrumentObj.name) as text|null)
|
||||
if(!newline || !in_range(instrumentObj, usr))
|
||||
return
|
||||
@@ -253,16 +216,17 @@
|
||||
return
|
||||
if(lentext(newline) > 50)
|
||||
newline = copytext(newline, 1, 50)
|
||||
lines.Add(newline)
|
||||
|
||||
lines.Insert(num, newline)
|
||||
|
||||
else if(href_list["deleteline"])
|
||||
var/num = round(text2num(href_list["deleteline"]))
|
||||
if(num > lines.len || num < 1)
|
||||
return
|
||||
lines.Cut(num, num+1)
|
||||
lines.Cut(num, num + 1)
|
||||
|
||||
else if(href_list["modifyline"])
|
||||
var/num = round(text2num(href_list["modifyline"]),1)
|
||||
var/num = round(text2num(href_list["modifyline"]))
|
||||
var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null)
|
||||
if(!content || !in_range(instrumentObj, usr))
|
||||
return
|
||||
@@ -275,19 +239,12 @@
|
||||
else if(href_list["stop"])
|
||||
playing = 0
|
||||
|
||||
updateDialog(usr)
|
||||
return
|
||||
|
||||
/datum/song/proc/sanitize_tempo(new_tempo)
|
||||
new_tempo = abs(new_tempo)
|
||||
return max(round(new_tempo, world.tick_lag), world.tick_lag)
|
||||
|
||||
// subclass for handheld instruments, like violin
|
||||
/datum/song/handheld
|
||||
|
||||
/datum/song/handheld/updateDialog(mob/user as mob)
|
||||
instrumentObj.interact(user)
|
||||
|
||||
/datum/song/handheld/shouldStopPlaying()
|
||||
if(instrumentObj)
|
||||
return !isliving(instrumentObj.loc)
|
||||
@@ -329,14 +286,16 @@
|
||||
..()
|
||||
|
||||
/obj/structure/piano/attack_hand(mob/user as mob)
|
||||
interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/structure/piano/interact(mob/user as mob)
|
||||
/obj/structure/piano/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!user || !anchored)
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
song.interact(user)
|
||||
song.ui_interact(user, ui_key, ui, force_open)
|
||||
|
||||
/obj/structure/piano/Topic(href, href_list)
|
||||
song.Topic(href, href_list)
|
||||
|
||||
/obj/structure/piano/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
if (istype(O, /obj/item/weapon/wrench))
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/obj/structure/stool/bed/chair/verb/rotate()
|
||||
set name = "Rotate Chair"
|
||||
set category = null
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(config.ghost_interaction)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/obj/structure/table
|
||||
name = "table"
|
||||
desc = "A square piece of metal standing on four metal legs. It can not move."
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon = 'icons/obj/smooth_structures/table.dmi'
|
||||
icon_state = "table"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
@@ -25,12 +25,8 @@
|
||||
var/flipped = 0
|
||||
var/health = 100
|
||||
var/busy = 0
|
||||
|
||||
/obj/structure/table/proc/update_adjacent()
|
||||
for(var/direction in list(1,2,4,8,5,6,9,10))
|
||||
if(locate(/obj/structure/table,get_step(src,direction)))
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
|
||||
T.update_icon()
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced)
|
||||
|
||||
/obj/structure/table/New()
|
||||
..()
|
||||
@@ -38,11 +34,6 @@
|
||||
if(T != src)
|
||||
qdel(T)
|
||||
update_icon()
|
||||
update_adjacent()
|
||||
|
||||
/obj/structure/table/Destroy()
|
||||
update_adjacent()
|
||||
return ..()
|
||||
|
||||
/obj/structure/table/proc/destroy()
|
||||
new parts(loc)
|
||||
@@ -50,6 +41,10 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/table/update_icon()
|
||||
if(smooth && !flipped)
|
||||
smooth_icon(src)
|
||||
smooth_icon_neighbors(src)
|
||||
|
||||
if(flipped)
|
||||
var/type = 0
|
||||
var/tabledirs = 0
|
||||
@@ -65,214 +60,9 @@
|
||||
base = "rtable"
|
||||
|
||||
icon_state = "[base]flip[type]"
|
||||
if (type==1)
|
||||
if (tabledirs & turn(dir,90))
|
||||
icon_state = icon_state+"-"
|
||||
if (tabledirs & turn(dir,-90))
|
||||
icon_state = icon_state+"+"
|
||||
|
||||
return 1
|
||||
|
||||
spawn(2) //So it properly updates when deleting
|
||||
var/dir_sum = 0
|
||||
for(var/direction in list(1,2,4,8,5,6,9,10))
|
||||
var/skip_sum = 0
|
||||
for(var/obj/structure/window/W in src.loc)
|
||||
if(W.dir == direction) //So smooth tables don't go smooth through windows
|
||||
skip_sum = 1
|
||||
continue
|
||||
var/inv_direction //inverse direction
|
||||
switch(direction)
|
||||
if(1)
|
||||
inv_direction = 2
|
||||
if(2)
|
||||
inv_direction = 1
|
||||
if(4)
|
||||
inv_direction = 8
|
||||
if(8)
|
||||
inv_direction = 4
|
||||
if(5)
|
||||
inv_direction = 10
|
||||
if(6)
|
||||
inv_direction = 9
|
||||
if(9)
|
||||
inv_direction = 6
|
||||
if(10)
|
||||
inv_direction = 5
|
||||
for(var/obj/structure/window/W in get_step(src,direction))
|
||||
if(W.dir == inv_direction) //So smooth tables don't go smooth through windows when the window is on the other table's tile
|
||||
skip_sum = 1
|
||||
continue
|
||||
if(!skip_sum) //means there is a window between the two tiles in this direction
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
|
||||
if(T && !T.flipped)
|
||||
if(direction <5)
|
||||
dir_sum += direction
|
||||
else
|
||||
if(direction == 5) //This permits the use of all table directions. (Set up so clockwise around the central table is a higher value, from north)
|
||||
dir_sum += 16
|
||||
if(direction == 6)
|
||||
dir_sum += 32
|
||||
if(direction == 8) //Aherp and Aderp. Jezes I am stupid. -- SkyMarshal
|
||||
dir_sum += 8
|
||||
if(direction == 10)
|
||||
dir_sum += 64
|
||||
if(direction == 9)
|
||||
dir_sum += 128
|
||||
|
||||
var/table_type = 0 //stand_alone table
|
||||
if(dir_sum%16 in cardinal)
|
||||
table_type = 1 //endtable
|
||||
dir_sum %= 16
|
||||
if(dir_sum%16 in list(3,12))
|
||||
table_type = 2 //1 tile thick, streight table
|
||||
if(dir_sum%16 == 3) //3 doesn't exist as a dir
|
||||
dir_sum = 2
|
||||
if(dir_sum%16 == 12) //12 doesn't exist as a dir.
|
||||
dir_sum = 4
|
||||
if(dir_sum%16 in list(5,6,9,10))
|
||||
if(locate(/obj/structure/table,get_step(src.loc,dir_sum%16)))
|
||||
table_type = 3 //full table (not the 1 tile thick one, but one of the 'tabledir' tables)
|
||||
else
|
||||
table_type = 2 //1 tile thick, corner table (treated the same as streight tables in code later on)
|
||||
dir_sum %= 16
|
||||
if(dir_sum%16 in list(13,14,7,11)) //Three-way intersection
|
||||
table_type = 5 //full table as three-way intersections are not sprited, would require 64 sprites to handle all combinations. TOO BAD -- SkyMarshal
|
||||
switch(dir_sum%16) //Begin computation of the special type tables. --SkyMarshal
|
||||
if(7)
|
||||
if(dir_sum == 23)
|
||||
table_type = 6
|
||||
dir_sum = 8
|
||||
else if(dir_sum == 39)
|
||||
dir_sum = 4
|
||||
table_type = 6
|
||||
else if(dir_sum == 55 || dir_sum == 119 || dir_sum == 247 || dir_sum == 183)
|
||||
dir_sum = 4
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 4
|
||||
if(11)
|
||||
if(dir_sum == 75)
|
||||
dir_sum = 5
|
||||
table_type = 6
|
||||
else if(dir_sum == 139)
|
||||
dir_sum = 9
|
||||
table_type = 6
|
||||
else if(dir_sum == 203 || dir_sum == 219 || dir_sum == 251 || dir_sum == 235)
|
||||
dir_sum = 8
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 8
|
||||
if(13)
|
||||
if(dir_sum == 29)
|
||||
dir_sum = 10
|
||||
table_type = 6
|
||||
else if(dir_sum == 141)
|
||||
dir_sum = 6
|
||||
table_type = 6
|
||||
else if(dir_sum == 189 || dir_sum == 221 || dir_sum == 253 || dir_sum == 157)
|
||||
dir_sum = 1
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 1
|
||||
if(14)
|
||||
if(dir_sum == 46)
|
||||
dir_sum = 1
|
||||
table_type = 6
|
||||
else if(dir_sum == 78)
|
||||
dir_sum = 2
|
||||
table_type = 6
|
||||
else if(dir_sum == 110 || dir_sum == 254 || dir_sum == 238 || dir_sum == 126)
|
||||
dir_sum = 2
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 2 //These translate the dir_sum to the correct dirs from the 'tabledir' icon_state.
|
||||
if(dir_sum%16 == 15)
|
||||
table_type = 4 //4-way intersection, the 'middle' table sprites will be used.
|
||||
|
||||
if(istype(src,/obj/structure/table/reinforced))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "reinf_table"
|
||||
if(1)
|
||||
icon_state = "reinf_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "reinf_1tilethick"
|
||||
if(3)
|
||||
icon_state = "reinf_tabledir"
|
||||
if(4)
|
||||
icon_state = "reinf_middle"
|
||||
if(5)
|
||||
icon_state = "reinf_tabledir2"
|
||||
if(6)
|
||||
icon_state = "reinf_tabledir3"
|
||||
else if(istype(src,/obj/structure/table/woodentable/poker))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "pokertable_table"
|
||||
if(1)
|
||||
icon_state = "pokertable_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "pokertable_1tilethick"
|
||||
if(3)
|
||||
icon_state = "pokertable_tabledir"
|
||||
if(4)
|
||||
icon_state = "pokertable_middle"
|
||||
if(5)
|
||||
icon_state = "pokertable_tabledir2"
|
||||
if(6)
|
||||
icon_state = "pokertable_tabledir3"
|
||||
else if(istype(src,/obj/structure/table/woodentable))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "wood_table"
|
||||
if(1)
|
||||
icon_state = "wood_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "wood_1tilethick"
|
||||
if(3)
|
||||
icon_state = "wood_tabledir"
|
||||
if(4)
|
||||
icon_state = "wood_middle"
|
||||
if(5)
|
||||
icon_state = "wood_tabledir2"
|
||||
if(6)
|
||||
icon_state = "wood_tabledir3"
|
||||
else if(istype(src,/obj/structure/table/glass))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "glass_table"
|
||||
if(1)
|
||||
icon_state = "glass_table_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "glass_table_1tilethick"
|
||||
if(3)
|
||||
icon_state = "glass_table_dir"
|
||||
if(4)
|
||||
icon_state = "glass_table_middle"
|
||||
if(5)
|
||||
icon_state = "glass_tabledir2"
|
||||
if(6)
|
||||
icon_state = "glass_tabledir3"
|
||||
else
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "table"
|
||||
if(1)
|
||||
icon_state = "table_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "table_1tilethick"
|
||||
if(3)
|
||||
icon_state = "tabledir"
|
||||
if(4)
|
||||
icon_state = "table_middle"
|
||||
if(5)
|
||||
icon_state = "tabledir2"
|
||||
if(6)
|
||||
icon_state = "tabledir3"
|
||||
if (dir_sum in list(1,2,4,8,5,6,9,10))
|
||||
dir = dir_sum
|
||||
else
|
||||
dir = 2
|
||||
|
||||
/obj/structure/table/ex_act(severity)
|
||||
switch(severity)
|
||||
@@ -395,27 +185,30 @@
|
||||
step(O, get_dir(O, src))
|
||||
return
|
||||
|
||||
/obj/structure/table/proc/tablepush(obj/item/I, mob/user)
|
||||
if(get_dist(src, user) < 2)
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(G.affecting.buckled)
|
||||
user << "<span class='warning'>[G.affecting] is buckled to [G.affecting.buckled]!</span>"
|
||||
return 0
|
||||
if(G.state < GRAB_AGGRESSIVE)
|
||||
user << "<span class='warning'>You need a better grip to do that!</span>"
|
||||
return 0
|
||||
if(!G.confirm())
|
||||
return 0
|
||||
G.affecting.forceMove(get_turf(src))
|
||||
G.affecting.Weaken(5)
|
||||
G.affecting.visible_message("<span class='danger'>[G.assailant] pushes [G.affecting] onto [src].</span>", \
|
||||
"<span class='userdanger'>[G.assailant] pushes [G.affecting] onto [src].</span>")
|
||||
add_logs(G.affecting, G.assailant, "pushed onto a table")
|
||||
qdel(I)
|
||||
return 1
|
||||
qdel(I)
|
||||
|
||||
/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
if (istype(G.affecting, /mob/living))
|
||||
var/mob/living/M = G.affecting
|
||||
if (G.state < 2)
|
||||
if(user.a_intent == I_HARM)
|
||||
if (prob(15)) M.Weaken(5)
|
||||
M.apply_damage(8,def_zone = "head")
|
||||
visible_message("\red [G.assailant] slams [G.affecting]'s face against \the [src]!")
|
||||
playsound(src.loc, 'sound/weapons/tablehit1.ogg', 50, 1)
|
||||
else
|
||||
user << "\red You need a better grip to do that!"
|
||||
return
|
||||
else
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
visible_message("\red [G.assailant] puts [G.affecting] on \the [src].")
|
||||
qdel(W)
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
tablepush(W, user)
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
user << "\blue Now disassembling table"
|
||||
@@ -523,7 +316,6 @@
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
|
||||
T.flip(direction)
|
||||
update_icon()
|
||||
update_adjacent()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -549,7 +341,6 @@
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
|
||||
T.unflip()
|
||||
update_icon()
|
||||
update_adjacent()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -559,9 +350,11 @@
|
||||
/obj/structure/table/woodentable
|
||||
name = "wooden table"
|
||||
desc = "Do not apply fire to this. Rumour says it burns easily."
|
||||
icon = 'icons/obj/smooth_structures/wood_table.dmi'
|
||||
icon_state = "wood_table"
|
||||
parts = /obj/item/weapon/table_parts/wood
|
||||
health = 50
|
||||
canSmoothWith = list(/obj/structure/table/woodentable, /obj/structure/table/woodentable/poker)
|
||||
|
||||
/obj/structure/table/woodentable/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
|
||||
@@ -574,20 +367,9 @@
|
||||
|
||||
|
||||
if (istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(G.affecting.buckled)
|
||||
user << "<span class='notice'>[G.affecting] is buckled to [G.affecting.buckled]!</span>"
|
||||
return
|
||||
if(G.state < GRAB_AGGRESSIVE)
|
||||
user << "<span class='notice'>You need a better grip to do that!</span>"
|
||||
return
|
||||
if(!G.confirm())
|
||||
return
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
visible_message("\red [G.assailant] puts [G.affecting] on the table.")
|
||||
qdel(I)
|
||||
tablepush(I, user)
|
||||
return
|
||||
|
||||
if (istype(I, /obj/item/weapon/wrench))
|
||||
user << "\blue Now disassembling the wooden table"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
@@ -628,26 +410,17 @@
|
||||
/obj/structure/table/woodentable/poker //No specialties, Just a mapping object.
|
||||
name = "gambling table"
|
||||
desc = "A seedy table for seedy dealings in seedy places."
|
||||
icon = 'icons/obj/smooth_structures/poker_table.dmi'
|
||||
icon_state = "pokertable"
|
||||
canSmoothWith = list(/obj/structure/table/woodentable/poker, /obj/structure/table/woodentable)
|
||||
|
||||
|
||||
/obj/structure/table/woodentable/poker/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = W
|
||||
if(G.affecting.buckled)
|
||||
user << "<span class='notice'>[G.affecting] is buckled to [G.affecting.buckled]!</span>"
|
||||
return
|
||||
if(G.state < GRAB_AGGRESSIVE)
|
||||
user << "<span class='notice'>You need a better grip to do that!</span>"
|
||||
return
|
||||
if(!G.confirm())
|
||||
return
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
visible_message("\red [G.assailant] puts [G.affecting] on the table.")
|
||||
qdel(W)
|
||||
tablepush(W, user)
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
user << "\blue Now disassembling the wooden table"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
@@ -721,38 +494,30 @@
|
||||
/obj/structure/table/glass
|
||||
name = "glass table"
|
||||
desc = "Looks fragile. You should totally flip it. It is begging for it."
|
||||
icon = 'icons/obj/smooth_structures/glass_table.dmi'
|
||||
icon_state = "glass_table"
|
||||
parts = /obj/item/weapon/table_parts/glass
|
||||
health = 10
|
||||
canSmoothWith = null
|
||||
|
||||
/obj/structure/table/glass/flip(var/direction)
|
||||
src.collapse()
|
||||
|
||||
/obj/structure/table/glass/proc/collapse() //glass table collapse is called twice in this code, more efficent to just have a proc
|
||||
src.visible_message("<span class='warning'>\The [src] shatters, and the frame collapses!</span>", "<span class='warning'>You hear metal collapsing and glass shattering.</span>")
|
||||
playsound(src.loc, "shatter", 50, 1)
|
||||
new /obj/item/weapon/table_parts/glass(loc)
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(prob(50)) //50% chance to spawn two shards
|
||||
new /obj/item/weapon/shard(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/table/glass/tablepush(obj/item/I, mob/user)
|
||||
if(..())
|
||||
collapse()
|
||||
|
||||
/obj/structure/table/glass/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
|
||||
if (istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(G.affecting.buckled)
|
||||
user << "<span class='notice'>[G.affecting] is buckled to [G.affecting.buckled]!</span>"
|
||||
return
|
||||
if(G.state < GRAB_AGGRESSIVE)
|
||||
user << "<span class='notice'>You need a better grip to do that!</span>"
|
||||
return
|
||||
if(!G.confirm())
|
||||
return
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(7)
|
||||
visible_message("<span class='warning'>[G.assailant] smashes [G.affecting] onto \the [src]!</span>")
|
||||
qdel(I)
|
||||
src.collapse()
|
||||
tablepush(I, user)
|
||||
return
|
||||
|
||||
if (istype(I, /obj/item/weapon/wrench))
|
||||
@@ -800,10 +565,12 @@
|
||||
/obj/structure/table/reinforced
|
||||
name = "reinforced table"
|
||||
desc = "A version of the four legged table. It is stronger."
|
||||
icon_state = "reinf_table"
|
||||
icon = 'icons/obj/smooth_structures/reinforced_table.dmi'
|
||||
icon_state = "r_table"
|
||||
health = 200
|
||||
var/status = 2
|
||||
parts = /obj/item/weapon/table_parts/reinforced
|
||||
canSmoothWith = list(/obj/structure/table/reinforced, /obj/structure/table)
|
||||
|
||||
/obj/structure/table/reinforced/flip(var/direction)
|
||||
if (status == 2)
|
||||
|
||||
@@ -273,33 +273,40 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
|
||||
|
||||
/obj/structure/window/verb/rotate()
|
||||
set name = "Rotate Window Counter-Clockwise"
|
||||
set category = null
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
usr << "It is fastened to the floor therefore you can't rotate it!"
|
||||
usr << "<span class='warning'>It is fastened to the floor therefore you can't rotate it!</span>"
|
||||
return 0
|
||||
|
||||
dir = turn(dir, 90)
|
||||
// updateSilicate()
|
||||
air_update_turf(1)
|
||||
ini_dir = dir
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/verb/revrotate()
|
||||
set name = "Rotate Window Clockwise"
|
||||
set category = null
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
usr << "It is fastened to the floor therefore you can't rotate it!"
|
||||
usr << "<span class='warning'>It is fastened to the floor therefore you can't rotate it!</span>"
|
||||
return 0
|
||||
|
||||
dir = turn(dir, 270)
|
||||
// updateSilicate()
|
||||
air_update_turf(1)
|
||||
ini_dir = dir
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user