Revert "[MIRROR] /atom New() => Initialize() [MDB IGNORE]"

This commit is contained in:
Novacat
2022-08-27 08:49:56 -04:00
committed by GitHub
parent 0be7af4774
commit 1aa4c73e8d
599 changed files with 3329 additions and 4983 deletions
+4 -4
View File
@@ -10,8 +10,8 @@
var/maxhealth = 100
var/datum/material/material
/obj/structure/barricade/Initialize(var/ml, var/material_name)
. = ..()
/obj/structure/barricade/New(var/newloc, var/material_name)
..(newloc)
if(!material_name)
material_name = "wood"
material = get_material_by_name("[material_name]")
@@ -116,10 +116,10 @@
icon = 'icons/obj/sandbags.dmi'
icon_state = "blank"
/obj/structure/barricade/sandbag/Initialize(var/ml, var/material_name)
/obj/structure/barricade/sandbag/New(var/newloc, var/material_name)
if(!material_name)
material_name = "cloth"
. = ..()
..(newloc, material_name)
material = get_material_by_name("[material_name]")
if(!material)
qdel(src)
+2 -2
View File
@@ -27,8 +27,8 @@
else
. += "It says '[icon_state]'"
/obj/structure/sign/double/barsign/Initialize()
. = ..()
/obj/structure/sign/double/barsign/New()
..()
icon_state = pick(get_valid_states())
/obj/structure/sign/double/barsign/attackby(obj/item/I, mob/user)
+8 -8
View File
@@ -13,8 +13,8 @@
var/set_temperature = T0C + 30 //K
var/heating_power = 80000
/obj/structure/bonfire/Initialize(var/ml, material_name)
. = ..()
/obj/structure/bonfire/New(newloc, material_name)
..(newloc)
if(!material_name)
material_name = MAT_WOOD
material = get_material_by_name("[material_name]")
@@ -24,15 +24,15 @@
color = material.icon_colour
// Blue wood.
/obj/structure/bonfire/sifwood/Initialize(var/ml, material_name)
. = ..(ml, MAT_SIFWOOD)
/obj/structure/bonfire/sifwood/New(newloc, material_name)
..(newloc, MAT_SIFWOOD)
/obj/structure/bonfire/permanent/Initialize(var/ml, material_name)
. = ..()
/obj/structure/bonfire/permanent/New(newloc, material_name)
..()
ignite()
/obj/structure/bonfire/permanent/sifwood/Initialize(var/ml, material_name)
. = ..(ml, MAT_SIFWOOD)
/obj/structure/bonfire/permanent/sifwood/New(newloc, material_name)
..(newloc, MAT_SIFWOOD)
/obj/structure/bonfire/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill)
+2 -4
View File
@@ -19,11 +19,9 @@
/obj/structure/catwalk/Initialize()
. = ..()
//Delete ourselves if we find extra mapped in catwalks
for(var/obj/structure/catwalk/C in loc)
for(var/obj/structure/catwalk/C in get_turf(src))
if(C != src)
log_debug("Duplicate catwalks at [x],[y],[z]")
return INITIALIZE_HINT_QDEL
qdel(C)
update_connections(1)
update_icon()
@@ -13,8 +13,7 @@
var/intialOxy = 0
var/timer = 240 //eventually the person will be freed
/obj/structure/closet/statue/Initialize(var/ml, var/mob/living/L)
. = ..()
/obj/structure/closet/statue/New(loc, var/mob/living/L)
if(L && (ishuman(L) || L.isMonkey() || iscorgi(L)))
if(L.buckled)
L.buckled = 0
@@ -42,8 +41,11 @@
desc = "If it takes forever, I will wait for you..."
if(health == 0) //meaning if the statue didn't find a valid target
return INITIALIZE_HINT_QDEL
qdel(src)
return
START_PROCESSING(SSobj, src)
..()
/obj/structure/closet/statue/process()
timer--
@@ -14,8 +14,7 @@
var/glass = 0 // 0 = glass can be installed. -1 = glass can't be installed. 1 = glass is already installed. Text = mineral plating is installed instead.
var/created_name = null
/obj/structure/door_assembly/Initialize()
. = ..()
/obj/structure/door_assembly/New()
update_state()
/obj/structure/door_assembly/door_assembly_com
@@ -137,8 +136,7 @@
airlock_type = "/multi_tile/glass"
glass = -1 //To prevent bugs in deconstruction process.
/obj/structure/door_assembly/multi_tile/Initialize()
. = ..()
/obj/structure/door_assembly/multi_tile/New()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
@@ -8,7 +8,7 @@
/obj/structure/bed/chair/e_chair/Initialize()
. = ..()
overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir)
add_overlay(image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir))
return
/obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
+2 -3
View File
@@ -9,13 +9,12 @@
var/obj/item/weapon/extinguisher/has_extinguisher
var/opened = 0
/obj/structure/extinguisher_cabinet/Initialize(var/ml, var/dir, var/building = 0)
/obj/structure/extinguisher_cabinet/Initialize(var/mapload, var/dir, var/building = 0)
. = ..()
if(building)
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
pixel_y = (dir & 3)? (dir ==1 ? -27 : 27) : 0
update_icon()
else
has_extinguisher = new/obj/item/weapon/extinguisher(src)
+34 -34
View File
@@ -103,8 +103,8 @@
harvest_loot = list(/obj/item/stack/material/fiber = 1)
max_harvests = 1
/obj/structure/flora/bush/Initialize()
. = ..()
/obj/structure/flora/bush/New()
..()
icon_state = "snowbush[rand(1, 6)]"
/obj/structure/flora/pottedplant
@@ -152,113 +152,113 @@
var/choice = pickweight(possibleseeds)
new choice(get_turf(user))
/obj/structure/flora/ausbushes/Initialize()
. = ..()
/obj/structure/flora/ausbushes/New()
..()
icon_state = "firstbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
/obj/structure/flora/ausbushes/reedbush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/reedbush/New()
..()
icon_state = "reedbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/leafybush
icon_state = "leafybush_1"
/obj/structure/flora/ausbushes/leafybush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/leafybush/New()
..()
icon_state = "leafybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/palebush
icon_state = "palebush_1"
/obj/structure/flora/ausbushes/palebush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/palebush/New()
..()
icon_state = "palebush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/stalkybush
icon_state = "stalkybush_1"
/obj/structure/flora/ausbushes/stalkybush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/stalkybush/New()
..()
icon_state = "stalkybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/grassybush
icon_state = "grassybush_1"
/obj/structure/flora/ausbushes/grassybush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/grassybush/New()
..()
icon_state = "grassybush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/fernybush
icon_state = "fernybush_1"
/obj/structure/flora/ausbushes/fernybush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/fernybush/New()
..()
icon_state = "fernybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/sunnybush
icon_state = "sunnybush_1"
/obj/structure/flora/ausbushes/sunnybush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/sunnybush/New()
..()
icon_state = "sunnybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/genericbush
icon_state = "genericbush_1"
/obj/structure/flora/ausbushes/genericbush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/genericbush/New()
..()
icon_state = "genericbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/pointybush
icon_state = "pointybush_1"
/obj/structure/flora/ausbushes/pointybush/Initialize()
. = ..()
/obj/structure/flora/ausbushes/pointybush/New()
..()
icon_state = "pointybush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/lavendergrass
icon_state = "lavendergrass_1"
/obj/structure/flora/ausbushes/lavendergrass/Initialize()
. = ..()
/obj/structure/flora/ausbushes/lavendergrass/New()
..()
icon_state = "lavendergrass_[rand(1, 4)]"
/obj/structure/flora/ausbushes/ywflowers
icon_state = "ywflowers_1"
/obj/structure/flora/ausbushes/ywflowers/Initialize()
. = ..()
/obj/structure/flora/ausbushes/ywflowers/New()
..()
icon_state = "ywflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/brflowers
icon_state = "brflowers_1"
/obj/structure/flora/ausbushes/brflowers/Initialize()
. = ..()
/obj/structure/flora/ausbushes/brflowers/New()
..()
icon_state = "brflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/ppflowers
icon_state = "ppflowers_1"
/obj/structure/flora/ausbushes/ppflowers/Initialize()
. = ..()
/obj/structure/flora/ausbushes/ppflowers/New()
..()
icon_state = "ppflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/sparsegrass
icon_state = "sparsegrass_1"
/obj/structure/flora/ausbushes/sparsegrass/Initialize()
. = ..()
/obj/structure/flora/ausbushes/sparsegrass/New()
..()
icon_state = "sparsegrass_[rand(1, 3)]"
/obj/structure/flora/ausbushes/fullgrass
icon_state = "fullgrass_1"
/obj/structure/flora/ausbushes/fullgrass/Initialize()
. = ..()
/obj/structure/flora/ausbushes/fullgrass/New()
..()
icon_state = "fullgrass_[rand(1, 3)]"
/obj/structure/flora/skeleton
+6 -6
View File
@@ -7,20 +7,20 @@
/obj/structure/flora/grass/brown
icon_state = "snowgrass1bb"
/obj/structure/flora/grass/brown/Initialize()
. = ..()
/obj/structure/flora/grass/brown/New()
..()
icon_state = "snowgrass[rand(1, 3)]bb"
/obj/structure/flora/grass/green
icon_state = "snowgrass1gb"
/obj/structure/flora/grass/green/Initialize()
. = ..()
/obj/structure/flora/grass/green/New()
..()
icon_state = "snowgrass[rand(1, 3)]gb"
/obj/structure/flora/grass/both
icon_state = "snowgrassall1"
/obj/structure/flora/grass/both/Initialize()
. = ..()
/obj/structure/flora/grass/both/New()
..()
icon_state = "snowgrassall[rand(1, 3)]"
@@ -50,5 +50,4 @@
/obj/structure/ghost_pod/ghost_activated/Initialize()
. = ..()
// LINTER FIX NOTE: as with poi_loader, would suggest queing this, or possibly having it occur on LateInitialize or something with a set waitfor = FALSE
addtimer(CALLBACK(src, .proc/ghostpod_startup, spawn_active), 0)
ghostpod_startup(spawn_active)
@@ -38,7 +38,7 @@
clothing_possibilities |= /obj/item/device/radio/headset
/obj/structure/ghost_pod/ghost_activated/human/create_occupant(var/mob/M)
. = ..()
..()
var/turf/T = get_turf(src)
var/mob/living/carbon/human/H = new(src)
+4 -4
View File
@@ -18,8 +18,8 @@
var/applies_material_colour = 1
var/wall_type = /turf/simulated/wall
/obj/structure/girder/Initialize(var/ml, var/material_key)
. = ..(ml)
/obj/structure/girder/New(var/newloc, var/material_key)
..(newloc)
if(!material_key)
material_key = default_material
set_material(material_key)
@@ -74,8 +74,8 @@
health = 50
cover = 25
/obj/structure/girder/displaced/Initialize(var/ml, var/material_key)
. = ..()
/obj/structure/girder/displaced/New(var/newloc, var/material_key)
..(newloc, material_key)
displace()
/obj/structure/girder/proc/displace()
+2 -2
View File
@@ -19,8 +19,8 @@
var/datum/material/material
/obj/structure/gravemarker/Initialize(var/ml, var/material_name)
. = ..(ml)
/obj/structure/gravemarker/New(var/newloc, var/material_name)
..(newloc)
if(!material_name)
material_name = "wood"
material = get_material_by_name("[material_name]")
+2 -2
View File
@@ -225,8 +225,8 @@
icon_state = "grille-b"
density = FALSE
/obj/structure/grille/broken/Initialize()
. = ..()
/obj/structure/grille/broken/New()
..()
health = rand(-5, -1) //In the destroyed but not utterly threshold.
healthcheck() //Send this to healthcheck just in case we want to do something else with it.
+2 -2
View File
@@ -34,8 +34,8 @@
var/health = 50.0
/obj/structure/inflatable/Initialize()
. = ..()
/obj/structure/inflatable/New(location)
..()
update_nearby_tiles(need_rebuild=1)
/obj/structure/inflatable/Destroy()
+1 -2
View File
@@ -383,8 +383,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
var/callme = "pimpin' ride" //how do people refer to it?
/obj/structure/bed/chair/janicart/Initialize()
. = ..()
/obj/structure/bed/chair/janicart/New()
create_reagents(300)
update_layer()
+2 -3
View File
@@ -11,15 +11,14 @@
var/glass = 1
var/datum/tgui_module/appearance_changer/mirror/M
/obj/structure/mirror/Initialize(var/ml, var/dir, var/building = 0, mob/user as mob)
. = ..()
/obj/structure/mirror/Initialize(mapload, var/dir, var/building = 0, mob/user as mob)
M = new(src, null)
if(building)
glass = 0
icon_state = "mirror_frame"
pixel_x = (dir & 3)? 0 : (dir == 4 ? -28 : 28)
pixel_y = (dir & 3)? (dir == 1 ? -30 : 30) : 0
return
/obj/structure/mirror/Destroy()
QDEL_NULL(M)
+2 -2
View File
@@ -12,9 +12,9 @@
GLOBAL_LIST_BOILERPLATE(all_mopbuckets, /obj/structure/mopbucket)
/obj/structure/mopbucket/Initialize()
/obj/structure/mopbucket/New()
create_reagents(300)
. = ..()
..()
/obj/structure/mopbucket/examine(mob/user)
. = ..()
-366
View File
@@ -1,366 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
#define MUSICIAN_HEARCHECK_MINDELAY 4
#define INSTRUMENT_MAX_LINE_LENGTH 50
#define INSTRUMENT_MAX_LINE_NUMBER 300
/datum/song
var/name = "Untitled"
var/list/lines = new()
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/instrumentDir = "piano" // the folder with the sounds
var/instrumentExt = "ogg" // the file extension
var/obj/instrumentObj = null // the associated obj playing the sound
var/last_hearcheck = 0
var/list/hearing_mobs
/datum/song/New(dir, obj, ext = "ogg")
instrumentDir = dir
instrumentObj = obj
instrumentExt = ext
/datum/song/Destroy()
instrumentObj = null
return ..()
// note is a number from 1-7 for A-G
// acc is either "b", "n", or "#"
// oct is 1-8 (or 9 for C)
/datum/song/proc/playnote(note, acc as text, oct)
// handle accidental -> B<>C of E<>F
if(acc == "b" && (note == 3 || note == 6)) // C or F
if(note == 3)
oct--
note--
acc = "n"
else if(acc == "#" && (note == 2 || note == 5)) // B or E
if(note == 2)
oct++
note++
acc = "n"
else if(acc == "#" && (note == 7)) //G#
note = 1
acc = "b"
else if(acc == "#") // mass convert all sharps to flats, octave jump already handled
acc = "b"
note++
// check octave, C is allowed to go to 9
if(oct < 1 || (note == 3 ? oct > 9 : oct > 8))
return
// now generate name
var/soundfile = "sound/instruments/[instrumentDir]/[ascii2text(note+64)][acc][oct].[instrumentExt]"
soundfile = file(soundfile)
// make sure the note exists
if(!fexists(soundfile))
return
// and play
var/turf/source = get_turf(instrumentObj)
if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/M in hearers(15, source))
if(!M.client || !(M.is_preference_enabled(/datum/client_preference/instrument_toggle)))
continue
LAZYSET(hearing_mobs, M, TRUE)
last_hearcheck = world.time
var/sound/music_played = sound(soundfile)
for(var/i in hearing_mobs)
var/mob/M = i
M.playsound_local(source, null, 100, falloff = 0.5, S = music_played)
/datum/song/proc/updateDialog(mob/user)
instrumentObj.updateDialog() // assumes it's an object in world, override if otherwise
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
if(!instrumentObj.Adjacent(user) || user.stat)
return 1
return !instrumentObj.anchored // add special cases to stop in subclasses
else
return 1
/datum/song/proc/playsong(mob/user)
while(repeat >= 0)
var/cur_oct[7]
var/cur_acc[7]
for(var/i = 1 to 7)
cur_oct[i] = 3
cur_acc[i] = "n"
for(var/line in lines)
for(var/beat in splittext(lowertext(line), ","))
var/list/notes = splittext(beat, "/")
for(var/note in splittext(notes[1], "-"))
if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case
playing = 0
return
if(length(note) == 0)
continue
var/cur_note = text2ascii(note) - 96
if(cur_note < 1 || cur_note > 7)
continue
for(var/i=2 to length(note))
var/ni = copytext(note,i,i+1)
if(!text2num(ni))
if(ni == "#" || ni == "b" || ni == "n")
cur_acc[cur_note] = ni
else if(ni == "s")
cur_acc[cur_note] = "#" // so shift is never required
else
cur_oct[cur_note] = text2num(ni)
playnote(cur_note, cur_acc[cur_note], cur_oct[cur_note])
if(notes.len >= 2 && text2num(notes[2]))
sleep(sanitize_tempo(tempo / text2num(notes[2])))
else
sleep(tempo)
repeat--
playing = 0
repeat = 0
updateDialog(user)
/datum/song/proc/interact(mob/user)
var/dat = ""
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>
Repeat Song:
[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>"]
[repeat] times
[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>"]
<BR>"}
else
dat += {"<SPAN CLASS='linkOn'>Play</SPAN> <A href='?src=\ref[src];stop=1'>Stop</A><BR>
Repeats left: <B>[repeat]</B><BR>"}
if(!edit)
dat += "<BR><B><A href='?src=\ref[src];edit=2'>Show Editor</A></B><BR>"
else
var/bpm = round(600 / tempo)
dat += {"<H3>Editing</H3>
<B><A href='?src=\ref[src];edit=1'>Hide Editor</A></B>
<A href='?src=\ref[src];newsong=1'>Start a New Song</A>
<A href='?src=\ref[src];import=1'>Import a Song</A><BR><BR>
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>
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 <i>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>"
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()
/datum/song/Topic(href, href_list)
if(!instrumentObj.Adjacent(usr) || usr.stat)
usr << browse(null, "window=instrument")
usr.unset_machine()
return
instrumentObj.add_fingerprint(usr)
if(href_list["newsong"])
lines = new()
tempo = sanitize_tempo(5) // default 120 BPM
name = ""
else if(href_list["import"])
var/t = ""
do
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
if(!in_range(instrumentObj, usr))
return
if(length(t) >= INSTRUMENT_MAX_LINE_LENGTH*INSTRUMENT_MAX_LINE_NUMBER)
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
if(cont == "no")
break
while(length(t) > INSTRUMENT_MAX_LINE_LENGTH*INSTRUMENT_MAX_LINE_NUMBER)
//split into lines
spawn()
lines = splittext(t, "\n")
if(copytext(lines[1],1,6) == "BPM: ")
tempo = sanitize_tempo(600 / text2num(copytext(lines[1],6)))
lines.Cut(1,2)
else
tempo = sanitize_tempo(5) // default 120 BPM
if(lines.len > INSTRUMENT_MAX_LINE_NUMBER)
to_chat(usr, "Too many lines!")
lines.Cut(INSTRUMENT_MAX_LINE_NUMBER+1)
var/linenum = 1
for(var/l in lines)
if(length(l) > INSTRUMENT_MAX_LINE_LENGTH)
to_chat(usr, "Line [linenum] too long!")
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
if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops.
if(playing)
return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing.
repeat += round(text2num(href_list["repeat"]))
if(repeat < 0)
repeat = 0
if(repeat > max_repeats)
repeat = max_repeats
else if(href_list["tempo"])
tempo = sanitize_tempo(tempo + text2num(href_list["tempo"]))
else if(href_list["play"])
playing = 1
spawn()
playsong(usr)
else if(href_list["newline"])
var/newline = html_encode(input("Enter your line: ", instrumentObj.name) as text|null)
if(!newline || !in_range(instrumentObj, usr))
return
if(lines.len > INSTRUMENT_MAX_LINE_NUMBER)
return
if(length(newline) > INSTRUMENT_MAX_LINE_LENGTH)
newline = copytext(newline, 1, INSTRUMENT_MAX_LINE_LENGTH)
lines.Add(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)
else if(href_list["modifyline"])
var/num = round(text2num(href_list["modifyline"]),1)
var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null)
if(!content || !in_range(instrumentObj, usr))
return
if(length(content) > INSTRUMENT_MAX_LINE_LENGTH)
content = copytext(content, 1, INSTRUMENT_MAX_LINE_LENGTH)
if(num > lines.len || num < 1)
return
lines[num] = content
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)
instrumentObj.interact(user)
/datum/song/handheld/shouldStopPlaying()
if(instrumentObj)
return !isliving(instrumentObj.loc)
else
return 1
//////////////////////////////////////////////////////////////////////////
/obj/structure/device/piano
name = "space piano"
desc = "This is a space piano; just like a regular piano, but always in tune! Even if the musician isn't."
icon = 'icons/obj/musician.dmi'
icon_state = "piano"
anchored = 1
density = 1
var/datum/song/song
/obj/structure/device/piano/minimoog
name = "space minimoog"
icon_state = "minimoog"
desc = "This is a minimoog; just like a space piano, but more spacey!"
/obj/structure/device/piano/Initialize()
. = ..()
song = new("piano", src)
if(prob(50))
name = "space minimoog"
desc = "This is a minimoog, like a space piano, but more spacey!"
icon_state = "minimoog"
else
name = "space piano"
desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't."
icon_state = "piano"
/obj/structure/device/piano/Destroy()
qdel(song)
song = null
..()
/obj/structure/device/piano/verb/rotate_clockwise()
set name = "Rotate Piano Clockwise"
set category = "Object"
set src in oview(1)
if(ismouse(usr))
return
if(!usr || !isturf(usr.loc) || usr.stat || usr.restrained())
return
if (isobserver(usr) && !config.ghost_interaction)
return
src.set_dir(turn(src.dir, 270))
/obj/structure/device/piano/attack_hand(mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
interact(user)
/obj/structure/device/piano/interact(mob/user)
if(!user || !anchored)
return
user.set_machine(src)
song.interact(user)
/obj/structure/device/piano/attackby(obj/item/O as obj, mob/user as mob)
if(O.is_wrench())
if(anchored)
playsound(src, O.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to loosen \the [src]'s casters...</span>")
if (do_after(user, 40 * O.toolspeed))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
"<span class='notice'>You have loosened \the [src]. Now it can be pulled somewhere else.</span>", \
"You hear ratchet.")
src.anchored = 0
else
playsound(src, O.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to tighten \the [src] to the floor...</span>")
if (do_after(user, 20 * O.toolspeed))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
"<span class='notice'>You have tightened \the [src]'s casters. Now it can be played again</span>.", \
"You hear ratchet.")
src.anchored = 1
else
..()
@@ -27,7 +27,6 @@
interaction_message = "<span class='notice'>The prismatic turret seems to be able to rotate.</span>"
/obj/structure/prop/prism/Initialize()
. = ..()
if(degrees_from_north)
animate(src, transform = turn(NORTH, degrees_from_north), time = 3)
@@ -252,7 +252,6 @@
icon_state = "stamper_on"
/obj/structure/prop/machine/stamper/starts_on/Initialize()
. = ..()
add_overlay("stamper_proc")
add_overlay("stamper_but")
@@ -581,7 +580,6 @@
var/contents_original_pixel_y = 0
/obj/structure/prop/machine/nt_pod/Initialize(mapload)
. = ..()
// Our non-map-preview state
icon_state = "nt_pod"
+1 -2
View File
@@ -51,8 +51,7 @@
layer = ABOVE_WINDOW_LAYER
interaction_message = "<span class = 'notice'>Cool to touch and unbelievable smooth. You can almost see your reflection in it.</span>"
/obj/structure/prop/statue/phoron/Initialize()
. = ..()
/obj/structure/prop/statue/phoron/New()
set_light(2, 3, "#cc66ff")
/obj/structure/prop/statue/pillar
+6 -3
View File
@@ -22,14 +22,17 @@
icon_modifier = "grey_"
icon_state = "grey_railing0"
/obj/structure/railing/Initialize(var/ml, constructed = 0)
. = ..()
/obj/structure/railing/New(loc, constructed = 0)
..()
// TODO - "constructed" is not passed to us. We need to find a way to do this safely.
if (constructed) // player-constructed railings
anchored = FALSE
if(climbable)
verbs += /obj/structure/proc/climb_on
if(anchored)
/obj/structure/railing/Initialize()
. = ..()
if(src.anchored)
update_icon(0)
/obj/structure/railing/Destroy()
+3 -2
View File
@@ -22,13 +22,14 @@ FLOOR SAFES
var/maxspace = 24 //the maximum combined w_class of stuff in the safe
/obj/structure/safe/Initialize()
. = ..()
/obj/structure/safe/New()
tumbler_1_pos = rand(0, 72)
tumbler_1_open = rand(0, 72)
tumbler_2_pos = rand(0, 72)
tumbler_2_open = rand(0, 72)
/obj/structure/safe/Initialize()
. = ..()
for(var/obj/item/I in loc)
+6 -6
View File
@@ -128,8 +128,8 @@
name = "\improper WARNING"
icon_state = "securearea"
/obj/structure/sign/warning/Initialize()
. = ..()
/obj/structure/sign/warning/New()
..()
desc = "A warning sign which reads '[name]'."
/obj/structure/sign/warning/airlock
@@ -185,8 +185,8 @@
name = "\improper LETHAL TURRETS"
icon_state = "turrets"
/obj/structure/sign/warning/lethal_turrets/Initialize()
. = ..()
/obj/structure/sign/warning/lethal_turrets/New()
..()
desc += " Enter at own risk!."
/obj/structure/sign/warning/mail_delivery
@@ -337,8 +337,8 @@
//disabled this proc, it serves no purpose except to overwrite the description that already exists. may have been intended for making your own signs?
//seems to defeat the point of having a generic directional sign that mappers could edit and use in POIs? left it here in case something breaks.
/*
/obj/structure/sign/directions/Initialize()
. = ..()
/obj/structure/sign/directions/New()
..()
desc = "A direction sign, pointing out the way to \the [src]."
*/
+34 -59
View File
@@ -22,26 +22,11 @@
hardness -= material.combustion_effect(get_turf(src),temperature, 0.3)
CheckHardness()
/obj/structure/simple_door/Initialize(var/material_name)
/obj/structure/simple_door/Initialize(mapload, var/material_name)
. = ..()
if(material_name && !material)
material = material_name
else if(!material)
material = DEFAULT_WALL_MATERIAL
set_material(material_name)
if(!material)
return INITIALIZE_HINT_QDEL
material = get_material_by_name(material)
hardness = max(1,round(material.integrity/10))
icon_state = material.door_icon_base
name = "[material.display_name] door"
color = material.icon_colour
if(material.opacity < 0.5)
set_opacity(0)
else
set_opacity(1)
if(material.products_need_process())
START_PROCESSING(SSobj, src)
update_nearby_tiles(need_rebuild=1)
/obj/structure/simple_door/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -227,59 +212,49 @@
if(3)
hardness -= 0.1
CheckHardness()
return
/obj/structure/simple_door/process()
if(!material.radioactivity)
return
SSradiation.radiate(src, round(material.radioactivity/3))
/obj/structure/simple_door/wood/Initialize()
. = ..()
/obj/structure/simple_door/iron/Initialize(mapload,var/material_name)
..(mapload, material_name || "iron")
/obj/structure/simple_door/silver/Initialize(mapload,var/material_name)
..(mapload, material_name || "silver")
/obj/structure/simple_door/gold/Initialize(mapload,var/material_name)
..(mapload, material_name || "gold")
/obj/structure/simple_door/uranium/Initialize(mapload,var/material_name)
..(mapload, material_name || "uranium")
/obj/structure/simple_door/sandstone/Initialize(mapload,var/material_name)
..(mapload, material_name || "sandstone")
/obj/structure/simple_door/phoron/Initialize(mapload,var/material_name)
..(mapload, material_name || "phoron")
/obj/structure/simple_door/diamond/Initialize(mapload,var/material_name)
..(mapload, material_name || "diamond")
/obj/structure/simple_door/wood/Initialize(mapload,var/material_name)
..(mapload, material_name || MAT_WOOD)
knock_sound = 'sound/machines/door/knock_wood.wav'
/obj/structure/simple_door/hardwood/Initialize()
. = ..()
knock_sound = 'sound/machines/door/knock_wood.wav'
/obj/structure/simple_door/hardwood/Initialize(mapload,var/material_name)
..(mapload, material_name || MAT_HARDWOOD)
/obj/structure/simple_door/sifwood/Initialize()
. = ..()
knock_sound = 'sound/machines/door/knock_wood.wav'
/obj/structure/simple_door/sifwood/Initialize(mapload,var/material_name)
..(mapload, material_name || MAT_SIFWOOD)
/obj/structure/simple_door/iron
material = MAT_IRON
/obj/structure/simple_door/resin/Initialize(mapload,var/material_name)
..(mapload, material_name || "resin")
/obj/structure/simple_door/silver
material = MAT_SILVER
/obj/structure/simple_door/gold
material = MAT_GOLD
/obj/structure/simple_door/uranium
material = MAT_URANIUM
/obj/structure/simple_door/sandstone
material = MAT_SANDSTONE
/obj/structure/simple_door/phoron
material = MAT_PHORON
/obj/structure/simple_door/diamond
material = MAT_DIAMOND
/obj/structure/simple_door/wood
material = MAT_WOOD
/obj/structure/simple_door/hardwood
material = MAT_HARDWOOD
/obj/structure/simple_door/sifwood
material = MAT_SIFWOOD
/obj/structure/simple_door/resin
material = "resin"
/obj/structure/simple_door/cult
material = "cult"
/obj/structure/simple_door/cult/Initialize(mapload,var/material_name)
..(mapload, material_name || "cult")
/obj/structure/simple_door/cult/TryToSwitchState(atom/user)
if(isliving(user))
@@ -22,8 +22,9 @@
var/base_icon = "bed"
var/applies_material_colour = 1
/obj/structure/bed/Initialize(var/ml, var/new_material, var/new_padding_material)
. = ..(ml)
/obj/structure/bed/New(var/newloc, var/new_material, var/new_padding_material)
..(newloc)
color = null
if(!new_material)
new_material = MAT_STEEL
material = get_material_by_name(new_material)
@@ -173,19 +174,19 @@
icon_state = "psychbed"
base_icon = "psychbed"
/obj/structure/bed/psych/Initialize(var/ml)
. = ..(ml, MAT_WOOD, MAT_LEATHER)
/obj/structure/bed/psych/New(var/newloc)
..(newloc,"wood","leather")
/obj/structure/bed/padded/Initialize(var/ml)
. = ..(ml, MAT_PLASTIC, MAT_CLOTH)
/obj/structure/bed/padded/New(var/newloc)
..(newloc,"plastic","cotton")
/obj/structure/bed/double
name = "double bed"
icon_state = "doublebed"
base_icon = "doublebed"
/obj/structure/bed/double/padded/Initialize(var/ml)
. = ..(ml, MAT_WOOD, MAT_CLOTH)
/obj/structure/bed/double/padded/New(var/newloc)
..(newloc,"wood","cotton")
/obj/structure/bed/double/post_buckle_mob(mob/living/M as mob)
if(M.buckled == src)
@@ -277,8 +278,8 @@
icon_state = "rollerbed"
var/obj/item/roller/held
/obj/item/roller_holder/Initialize()
. = ..()
/obj/item/roller_holder/New()
..()
held = new /obj/item/roller(src)
/obj/item/roller_holder/attack_self(mob/user as mob)
@@ -99,38 +99,38 @@
icon_state = "comfychair"
base_icon = "comfychair"
/obj/structure/bed/chair/comfy/brown/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, MAT_LEATHER)
/obj/structure/bed/chair/comfy/brown/New(var/newloc,var/newmaterial)
..(newloc,"steel","leather")
/obj/structure/bed/chair/comfy/red/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "carpet")
/obj/structure/bed/chair/comfy/red/New(var/newloc,var/newmaterial)
..(newloc,"steel","carpet")
/obj/structure/bed/chair/comfy/teal/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "teal")
/obj/structure/bed/chair/comfy/teal/New(var/newloc,var/newmaterial)
..(newloc,"steel","teal")
/obj/structure/bed/chair/comfy/black/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "black")
/obj/structure/bed/chair/comfy/black/New(var/newloc,var/newmaterial)
..(newloc,"steel","black")
/obj/structure/bed/chair/comfy/green/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "green")
/obj/structure/bed/chair/comfy/green/New(var/newloc,var/newmaterial)
..(newloc,"steel","green")
/obj/structure/bed/chair/comfy/purp/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "purple")
/obj/structure/bed/chair/comfy/purp/New(var/newloc,var/newmaterial)
..(newloc,"steel","purple")
/obj/structure/bed/chair/comfy/blue/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "blue")
/obj/structure/bed/chair/comfy/blue/New(var/newloc,var/newmaterial)
..(newloc,"steel","blue")
/obj/structure/bed/chair/comfy/beige/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "beige")
/obj/structure/bed/chair/comfy/beige/New(var/newloc,var/newmaterial)
..(newloc,"steel","beige")
/obj/structure/bed/chair/comfy/lime/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "lime")
/obj/structure/bed/chair/comfy/lime/New(var/newloc,var/newmaterial)
..(newloc,"steel","lime")
/obj/structure/bed/chair/comfy/yellow/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "yellow")
/obj/structure/bed/chair/comfy/yellow/New(var/newloc,var/newmaterial)
..(newloc,"steel","yellow")
/obj/structure/bed/chair/comfy/orange/Initialize(var/ml,var/newmaterial)
. = ..(ml, MAT_STEEL, "orange")
/obj/structure/bed/chair/comfy/orange/New(var/newloc,var/newmaterial)
..(newloc,"steel","orange")
/obj/structure/bed/chair/office
anchored = FALSE
@@ -210,8 +210,8 @@
return
..()
/obj/structure/bed/chair/wood/Initialize(var/ml, var/newmaterial)
. = ..(ml, MAT_WOOD)
/obj/structure/bed/chair/wood/New(var/newloc)
..(newloc, "wood")
/obj/structure/bed/chair/wood/wings
icon_state = "wooden_chair_wings"
@@ -18,8 +18,8 @@ var/global/list/stool_cache = list() //haha stool
/obj/item/weapon/stool/padded
icon_state = "stool_padded_preview" //set for the map
/obj/item/weapon/stool/Initialize(var/ml, var/new_material, var/new_padding_material)
. = ..()
/obj/item/weapon/stool/New(var/newloc, var/new_material, var/new_padding_material)
..(newloc)
if(!new_material)
new_material = MAT_STEEL
material = get_material_by_name(new_material)
@@ -31,8 +31,8 @@ var/global/list/stool_cache = list() //haha stool
force = round(material.get_blunt_damage()*0.4)
update_icon()
/obj/item/weapon/stool/padded/Initialize(var/ml, var/new_material)
. = ..(ml, MAT_STEEL, "carpet")
/obj/item/weapon/stool/padded/New(var/newloc, var/new_material)
..(newloc, "steel", "carpet")
/obj/item/weapon/stool/update_icon()
// Prep icon.
@@ -149,22 +149,3 @@ var/global/list/stool_cache = list() //haha stool
remove_padding()
else
..()
/obj/item/weapon/stool/barstool
name = "bar stool"
desc = "Apply butt."
icon = 'icons/obj/furniture.dmi'
icon_state = "bar_stool_preview" //set for the map
randpixel = 0
center_of_mass = null
force = 10
throwforce = 10
w_class = ITEMSIZE_HUGE
base_icon = "bar_stool_base"
anchored = 1
/obj/item/weapon/stool/barstool/padded
icon_state = "bar_stool_padded_preview" //set for the map
/obj/item/weapon/stool/barstool/padded/Initialize(var/ml, var/new_material)
. = ..(ml, MAT_STEEL, "carpet")
+20 -6
View File
@@ -78,18 +78,26 @@
/obj/structure/transit_tube_pod/Initialize()
. = ..()
/obj/structure/transit_tube_pod/New(loc)
..(loc)
air_contents.adjust_multi("oxygen", MOLES_O2STANDARD * 2, "nitrogen", MOLES_N2STANDARD)
air_contents.temperature = T20C
// Give auto tubes time to align before trying to start moving
addtimer(CALLBACK(src, .proc/follow_tube), 5)
/obj/structure/transit_tube/Initialize()
. = ..(loc)
// Give auto tubes time to align before trying to start moving
spawn(5)
follow_tube()
/obj/structure/transit_tube/New(loc)
..(loc)
if(tube_dirs == null)
init_dirs()
/obj/structure/transit_tube/Bumped(mob/AM as mob|obj)
var/obj/structure/transit_tube/T = locate() in AM.loc
if(T)
@@ -99,6 +107,12 @@
AM.loc = src.loc
to_chat(AM, "<span class='info'>You slip under the tube.</span>")
/obj/structure/transit_tube/station/New(loc)
..(loc)
/obj/structure/transit_tube/station/Bumped(mob/AM as mob|obj)
if(!pod_moving && icon_state == "open" && istype(AM, /mob))
for(var/obj/structure/transit_tube_pod/pod in loc)
+1 -2
View File
@@ -12,8 +12,7 @@
var/w_items = 0 //the combined w_class of all the items in the cistern
var/mob/living/swirlie = null //the mob being given a swirlie
/obj/structure/toilet/Initialize()
. = ..()
/obj/structure/toilet/New()
open = round(rand(0, 1))
update_icon()
@@ -32,8 +32,8 @@
secure = "secure_"
icon_state = "l_secure_windoor_assembly01"
/obj/structure/windoor_assembly/Initialize(var/ml, start_dir=NORTH, constructed=0)
. = ..()
/obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0)
..()
if(constructed)
state = "01"
anchored = FALSE
@@ -43,6 +43,7 @@
else //If the user is facing northeast. northwest, southeast, southwest or north, default to north
set_dir(NORTH)
update_state()
update_nearby_tiles(need_rebuild=1)
/obj/structure/windoor_assembly/Destroy()
+20 -23
View File
@@ -386,28 +386,25 @@
update_nearby_tiles(need_rebuild=1)
return
/obj/structure/window/Initialize(var/ml, start_dir=null, constructed=0)
. = ..()
if (start_dir)
set_dir(start_dir)
//player-constructed windows
if (constructed)
anchored = 0
state = 0
update_verbs()
health = maxhealth
ini_dir = dir
update_nearby_tiles(need_rebuild=1)
update_nearby_icons()
for(var/obj/structure/table/T in view(src, 1))
T.update_connections()
T.update_icon()
/obj/structure/window/New(Loc, start_dir=null, constructed=0)
..()
if (start_dir)
set_dir(start_dir)
//player-constructed windows
if (constructed)
anchored = FALSE
state = 0
update_verbs()
health = maxhealth
ini_dir = dir
update_nearby_tiles(need_rebuild=1)
update_nearby_icons()
/obj/structure/window/Destroy()
density = FALSE
@@ -697,4 +694,4 @@
to_chat(user, span("notice", "You deconstruct \the [src]."))
qdel(src)
return TRUE
return FALSE
return FALSE