Merge remote-tracking branch 'remotes/git-svn' (r4527) into bs12_with_tgport

Conflicts:
	baystation12.dme
	code/game/gamemodes/cult/runes.dm
	code/game/gamemodes/events.dm
	code/game/machinery/telecomms/broadcaster.dm
	code/game/machinery/telecomms/machine_interactions.dm
	code/game/objects/devices/uplinks.dm
	code/game/objects/weapons.dm
	code/modules/mining/mine_items.dm
	html/changelog.html
	icons/obj/chemical.dmi
	maps/tgstation.2.0.9.dmm

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-08-24 21:55:58 +10:00
121 changed files with 8992 additions and 7779 deletions

View File

@@ -1,805 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
var/wordtravel = null
var/wordself = null
var/wordsee = null
var/wordhell = null
var/wordblood = null
var/wordjoin = null
var/wordtech = null
var/worddestr = null
var/wordother = null
//var/wordhear = null
//var/wordfree = null
var/wordhide = null
var/runedec = 0
var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide")
/client/proc/check_words() // -- Urist
set category = "Special Verbs"
set name = "Check Rune Words"
set desc = "Check the rune-word meaning"
if(!wordtravel)
runerandom()
usr << "[wordtravel] is travel, [wordblood] is blood, [wordjoin] is join, [wordhell] is Hell, [worddestr] is destroy, [wordtech] is technology, [wordself] is self, [wordsee] is see, [wordother] is other, [wordhide] is hide."
/proc/runerandom() //randomizes word meaning
var/list/runewords=list("ire","ego","nahlizet","certum","veri","jatkaa","mgar","balaq", "karazet", "geeri") ///"orkan" and "allaq" removed.
wordtravel=pick(runewords)
runewords-=wordtravel
wordself=pick(runewords)
runewords-=wordself
wordsee=pick(runewords)
runewords-=wordsee
wordhell=pick(runewords)
runewords-=wordhell
wordblood=pick(runewords)
runewords-=wordblood
wordjoin=pick(runewords)
runewords-=wordjoin
wordtech=pick(runewords)
runewords-=wordtech
worddestr=pick(runewords)
runewords-=worddestr
wordother=pick(runewords)
runewords-=wordother
// wordhear=pick(runewords)
// runewords-=wordhear
// wordfree=pick(runewords)
// runewords-=wordfree
wordhide=pick(runewords)
runewords-=wordhide
/obj/effect/rune
desc = ""
anchored = 1
icon = 'icons/obj/rune.dmi'
icon_state = "1"
var/visibility = 0
unacidable = 1
layer = TURF_LAYER
var/word1
var/word2
var/word3
// Places these combos are mentioned: this file - twice in the rune code, once in imbued tome, once in tome's HTML runes.dm - in the imbue rune code. If you change a combination - dont forget to change it everywhere.
// travel self [word] - Teleport to random [rune with word destination matching]
// travel other [word] - Portal to rune with word destination matching - kinda doesnt work. At least the icon. No idea why.
// see blood Hell - Create a new tome
// join blood self - Incorporate person over the rune into the group
// Hell join self - Summon TERROR
// destroy see technology - EMP rune
// travel blood self - Drain blood
// see Hell join - See invisible
// blood join Hell - Raise dead
// hide see blood - Hide nearby runes
// blood see hide - Reveal nearby runes - The point of this rune is that its reversed obscure rune. So you always know the words to reveal the rune once oyu have obscured it.
// Hell travel self - Leave your body and ghost around
// blood see travel - Manifest a ghost into a mortal body
// Hell tech join - Imbue a rune into a talisman
// Hell blood join - Sacrifice rune
// destroy travel self - Wall rune
// join other self - Summon cultist rune
// travel technology other - Freeing rune // other blood travel was freedom join other
// hide other see - Deafening rune // was destroy see hear
// destroy see other - Blinding rune
// destroy see blood - BLOOD BOIL
// self other technology - Communication rune //was other hear blood
// join hide technology - stun rune. Rune color: bright pink.
New()
..()
var/image/blood = image(loc = src)
blood.override = 1
for(var/mob/living/silicon/ai/AI in player_list)
AI.client.images += blood
examine()
set src in view(2)
if(!iscultist(usr))
usr << "A strange collection of symbols drawn in blood."
return
/* Explosions... really?
if(desc && !usr.stat)
usr << "It reads: <i>[desc]</i>."
sleep(30)
explosion(src.loc, 0, 2, 5, 5)
if(src)
del(src)
*/
if(!desc)
usr << "A spell circle drawn in blood. It reads: <i>[word1] [word2] [word3]</i>."
else
usr << "Explosive Runes inscription in blood. It reads: <i>[desc]</i>."
return
attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/tome) && iscultist(user))
user << "You retrace your steps, carefully undoing the lines of the rune."
del(src)
return
else if(istype(I, /obj/item/weapon/nullrod))
user << "\blue You disrupt the vile magic with the deadening field of the null rod!"
del(src)
return
return
attack_hand(mob/living/user as mob)
if(!iscultist(user))
user << "You can't mouth the arcane scratchings without fumbling over them."
return
if(istype(user.wear_mask, /obj/item/clothing/mask/muzzle))
user << "You are unable to speak the words of the rune."
return
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))
return fizzle()
// if(!src.visibility)
// src.visibility=1
if(word1 == wordtravel && word2 == wordself)
return teleport(src.word3)
if(word1 == wordsee && word2 == wordblood && word3 == wordhell)
return tomesummon()
if(word1 == wordhell && word2 == worddestr && word3 == wordother)
return armor()
if(word1 == wordjoin && word2 == wordblood && word3 == wordself)
return convert()
if(word1 == wordhell && word2 == wordjoin && word3 == wordself)
return tearreality()
if(word1 == worddestr && word2 == wordsee && word3 == wordtech)
return emp(src.loc,3)
if(word1 == wordtravel && word2 == wordblood && word3 == wordself)
return drain()
if(word1 == wordsee && word2 == wordhell && word3 == wordjoin)
return seer()
if(word1 == wordblood && word2 == wordjoin && word3 == wordhell)
return raise()
if(word1 == wordhide && word2 == wordsee && word3 == wordblood)
return obscure(4)
if(word1 == wordhell && word2 == wordtravel && word3 == wordself)
return ajourney()
if(word1 == wordblood && word2 == wordsee && word3 == wordtravel)
return manifest()
if(word1 == wordhell && word2 == wordtech && word3 == wordjoin)
return talisman()
if(word1 == wordhell && word2 == wordblood && word3 == wordjoin)
return sacrifice()
if(word1 == wordblood && word2 == wordsee && word3 == wordhide)
return revealrunes(src)
if(word1 == worddestr && word2 == wordtravel && word3 == wordself)
return wall()
if(word1 == wordtravel && word2 == wordtech && word3 == wordother)
return freedom()
if(word1 == wordjoin && word2 == wordother && word3 == wordself)
return cultsummon()
if(word1 == wordhide && word2 == wordother && word3 == wordsee)
return deafen()
if(word1 == worddestr && word2 == wordsee && word3 == wordother)
return blind()
if(word1 == worddestr && word2 == wordsee && word3 == wordblood)
return bloodboil()
if(word1 == wordself && word2 == wordother && word3 == wordtech)
return communicate()
if(word1 == wordtravel && word2 == wordother)
return itemport(src.word3)
if(word1 == wordjoin && word2 == wordhide && word3 == wordtech)
return runestun()
else
return fizzle()
proc
fizzle()
if(istype(src,/obj/effect/rune))
usr.say(pick("B'ADMINES SP'WNIN SH'T","IC'IN O'OC","RO'SHA'M I'SA GRI'FF'N ME'AI","TOX'IN'S O'NM FI'RAH","IA BL'AME TOX'IN'S","FIR'A NON'AN RE'SONA","A'OI I'RS ROUA'GE","LE'OAN JU'STA SP'A'C Z'EE SH'EF","IA PT'WOBEA'RD, IA A'DMI'NEH'LP"))
else
usr.whisper(pick("B'ADMINES SP'WNIN SH'T","IC'IN O'OC","RO'SHA'M I'SA GRI'FF'N ME'AI","TOX'IN'S O'NM FI'RAH","IA BL'AME TOX'IN'S","FIR'A NON'AN RE'SONA","A'OI I'RS ROUA'GE","LE'OAN JU'STA SP'A'C Z'EE SH'EF","IA PT'WOBEA'RD, IA A'DMI'NEH'LP"))
for (var/mob/V in viewers(src))
V.show_message("\red The markings pulse with a small burst of light, then fall dark.", 3, "\red You hear a faint fizzle.", 2)
return
check_icon()
if(word1 == wordtravel && word2 == wordself)
icon_state = "2"
src.icon += rgb(0, 0 , 255)
return
if(word1 == wordjoin && word2 == wordblood && word3 == wordself)
icon_state = "3"
return
if(word1 == wordhell && word2 == wordjoin && word3 == wordself)
icon_state = "4"
return
if(word1 == wordsee && word2 == wordblood && word3 == wordhell)
icon_state = "5"
src.icon += rgb(0, 0 , 255)
return
if(word1 == worddestr && word2 == wordsee && word3 == wordtech)
icon_state = "5"
return
if(word1 == wordtravel && word2 == wordblood && word3 == wordself)
icon_state = "2"
return
if(word1 == wordsee && word2 == wordhell && word3 == wordjoin)
icon_state = "4"
src.icon += rgb(0, 0 , 255)
return
if(word1 == wordblood && word2 == wordjoin && word3 == wordhell)
icon_state = "1"
return
if(word1 == wordhide && word2 == wordsee && word3 == wordblood)
icon_state = "1"
src.icon += rgb(0, 0 , 255)
return
if(word1 == wordhell && word2 == wordtravel && word3 == wordself)
icon_state = "6"
src.icon += rgb(0, 0 , 255)
return
if(word1 == wordblood && word2 == wordsee && word3 == wordtravel)
icon_state = "6"
return
if(word1 == wordhell && word2 == wordtech && word3 == wordjoin)
icon_state = "3"
src.icon += rgb(0, 0 , 255)
return
if(word1 == wordhell && word2 == wordblood && word3 == wordjoin)
icon_state = "[rand(1,6)]"
src.icon += rgb(255, 255, 255)
return
if(word1 == wordblood && word2 == wordsee && word3 == wordhide)
icon_state = "4"
src.icon += rgb(255, 255, 255)
return
if(word1 == worddestr && word2 == wordtravel && word3 == wordself)
icon_state = "1"
src.icon += rgb(255, 0, 0)
return
if(word1 == wordtravel && word2 == wordtech && word3 == wordother)
icon_state = "4"
src.icon += rgb(255, 0, 255)
return
if(word1 == wordjoin && word2 == wordother && word3 == wordself)
icon_state = "2"
src.icon += rgb(0, 255, 0)
return
if(word1 == wordhide && word2 == wordother && word3 == wordsee)
icon_state = "4"
src.icon += rgb(0, 255, 0)
return
if(word1 == worddestr && word2 == wordsee && word3 == wordother)
icon_state = "4"
src.icon += rgb(0, 0, 255)
return
if(word1 == worddestr && word2 == wordsee && word3 == wordblood)
icon_state = "4"
src.icon += rgb(255, 0, 0)
return
if(word1 == wordself && word2 == wordother && word3 == wordtech)
icon_state = "3"
src.icon += rgb(200, 0, 0)
return
if(word1 == wordtravel && word2 == wordother)
icon_state = "1"
src.icon += rgb(200, 0, 0)
if(word1 == wordjoin && word2 == wordhide && word3 == wordtech)
icon_state = "2"
src.icon += rgb(100, 0, 100)
return
icon_state="[rand(1,6)]" //random shape and color for dummy runes
src.icon -= rgb(255,255,255)
src.icon += rgb(rand(1,255),rand(1,255),rand(1,255))
/obj/item/weapon/tome
name = "arcane tome"
icon_state ="tome"
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS
var/notedat = ""
var/tomedat = ""
var/list/words = list("ire" = "ire", "ego" = "ego", "nahlizet" = "nahlizet", "certum" = "certum", "veri" = "veri", "jatkaa" = "jatkaa", "balaq" = "balaq", "mgar" = "mgar", "karazet" = "karazet", "geeri" = "geeri")
tomedat = {"<html>
<head>
<style>
h1 {font-size: 25px; margin: 15px 0px 5px;}
h2 {font-size: 20px; margin: 15px 0px 5px;}
li {margin: 2px 0px 2px 15px;}
ul {list-style: none; margin: 5px; padding: 0px;}
ol {margin: 5px; padding: 0px 15px;}
</style>
</head>
<body>
<h1>The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood.</h1>
<i>The book is written in an unknown dialect, there are lots of pictures of various complex geometric shapes. You find some notes in english that give you basic understanding of the many runes written in the book. The notes give you an understanding what the words for the runes should be. However, you do not know how to write all these words in this dialect.</i><br>
<i>Below is the summary of the runes.</i> <br>
<h2>Contents</h2>
<p>
<b>Teleport self: </b>Travel Self (word)<br>
<b>Teleport other: </b>Travel Other (word)<br>
<b>Summon new tome: </b>See Blood Hell<br>
<b>Convert a person: </b>Join Blood Self<br>
<b>Summon Nar-Sie: </b>Hell Join Self<br>
<b>Disable technology: </b>Destroy See Technology<br>
<b>Drain blood: </b>Travel Blood Self<br>
<b>Raise dead: </b>Blood Join Hell<br>
<b>Hide runes: </b>Hide See Blood<br>
<b>Reveal hidden runes: </b>Blood See Hide<br>
<b>Leave your body: </b>Hell travel self<br>
<b>Ghost Manifest: </b>Blood See Travel<br>
<b>Imbue a talisman: </b>Hell Technology Join<br>
<b>Sacrifice: </b>Hell Blood Join<br>
<b>Create a wall: </b>Destroy Travel Self<br>
<b>Summon cultist: </b>Join Other Self<br>
<b>Free a cultist: </b>Travel technology other<br>
<b>Deafen: </b>Hide Other See<br>
<b>Blind: </b>Destroy See Other<br>
<b>Blood Boil: </b>Destroy See Blood<br>
<b>Communicate: </b>Self Other Technology<br>
<b>Stun: </b>Join Hide Technology<br>
<b>Summon Cultist Armor: </b>Hell Destroy Other<br>
<b>See Invisible: </b>See Hell Join<br>
</p>
<h2>Rune Descriptions</h2>
<h3>Teleport self</h3>
Teleport rune is a special rune, as it only needs two words, with the third word being destination. Basically, when you have two runes with the same destination, invoking one will teleport you to the other one. If there are more than 2 runes, you will be teleported to a random one. Runes with different third words will create separate networks. You can imbue this rune into a talisman, giving you a great escape mechanism.<br>
<h3>Teleport other</h3>
Teleport other allows for teleportation for any movable object to another rune with the same third word. You need 3 cultists chanting the invocation for this rune to work.<br>
<h3>Summon new tome</h3>
Invoking this rune summons a new arcane tome.
<h3>Convert a person</h3>
This rune opens target's mind to the realm of Nar-Sie, which usually results in this person joining the cult. However, some people (mostly the ones who posess high authority) have strong enough will to stay true to their old ideals. <br>
<h3>Summon Nar-Sie</h3>
The ultimate rune. It summons the Avatar of Nar-Sie himself, tearing a huge hole in reality and consuming everything around it. Summoning it is the final goal of any cult.<br>
<h3>Disable Technology</h3>
Invoking this rune creates a strong electromagnetic pulse in a small radius, making it basically analogic to an EMP grenade. You can imbue this rune into a talisman, making it a decent defensive item.<br>
<h3>Drain Blood</h3>
This rune instantly heals you of some brute damage at the expense of a person placed on top of the rune. Whenever you invoke a drain rune, ALL drain runes on the station are activated, draining blood from anyone located on top of those runes. This includes yourself, though the blood you drain from yourself just comes back to you. This might help you identify this rune when studying words. One drain gives up to 25HP per each victim, but you can repeat it if you need more. Draining only works on living people, so you might need to recharge your "Battery" once its empty. Drinking too much blood at once might cause blood hunger.<br>
<h3>Raise Dead</h3>
This rune allows for the resurrection of any dead person. You will need a dead human body and a living human sacrifice. Make 2 raise dead runes. Put a living non-braindead human on top of one, and a dead body on the other one. When you invoke the rune, the life force of the living human will be transferred into the dead body, allowing a ghost standing on top of the dead body to enter it, instantly and fully healing it. Use other runes to ensure there is a ghost ready to be resurrected.<br>
<h3>Hide runes</h3>
This rune makes all nearby runes completely invisible. They are still there and will work if activated somehow, but you cannot invoke them directly if you do not see them.<br>
<h3>Reveal runes</h3>
This rune is made to reverse the process of hiding a rune. It reveals all hidden runes in a rather large area around it.
<h3>Leave your body</h3>
This rune gently rips your soul out of your body, leaving it intact. You can observe the surroundings as a ghost as well as communicate with other ghosts. Your body takes damage while you are there, so ensure your journey is not too long, or you might never come back.<br>
<h3>Manifest a ghost</h3>
Unlike the Raise Dead rune, this rune does not require any special preparations or vessels. Instead of using full lifeforce of a sacrifice, it will drain YOUR lifeforce. Stand on the rune and invoke it. If theres a ghost standing over the rune, it will materialise, and will live as long as you dont move off the rune or die. You can put a paper with a name on the rune to make the new body look like that person.<br>
<h3>Imbue a talisman</h3>
This rune allows you to imbue the magic of some runes into paper talismans. Create an imbue rune, then an appropriate rune beside it. Put an empty piece of paper on the imbue rune and invoke it. You will now have a one-use talisman with the power of the target rune. Using a talisman drains some health, so be careful with it. You can imbue a talisman with power of the following runes: summon tome, reveal, conceal, teleport, tisable technology, communicate, deafen, blind and stun.<br>
<h3>Sacrifice</h3>
Sacrifice rune allows you to sacrifice a living thing or a body to the Geometer of Blood. Monkeys and dead humans are the most basic sacrifices, they might or might not be enough to gain His favor. A living human is what a real sacrifice should be, however, you will need 3 people chanting the invocation to sacrifice a living person.
<h3>Create a wall</h3>
Invoking this rune solidifies the air above it, creating an an invisible wall. To remove the wall, simply invoke the rune again.
<h3>Summon cultist</h3>
This rune allows you to summon a fellow cultist to your location. The target cultist must be unhandcuffed ant not buckled to anything. You also need to have 3 people chanting at the rune to succesfully invoke it. Invoking it takes heavy strain on the bodies of all chanting cultists.<br>
<h3>Free a cultist</h3>
This rune unhandcuffs and unbuckles any cultist of your choice, no matter where he is. You need to have 3 people invoking the rune for it to work. Invoking it takes heavy strain on the bodies of all chanting cultists.<br>
<h3>Deafen</h3>
This rune temporarily deafens all non-cultists around you.<br>
<h3>Blind</h3>
This rune temporarily blinds all non-cultists around you. Very robust. Use together with the deafen rune to leave your enemies completely helpless.<br>
<h3>Blood boil</h3>
This rune boils the blood all non-cultists in visible range. The damage is enough to instantly critically hurt any person. You need 3 cultists invoking the rune for it to work. This rune is unreliable and may cause unpredicted effect when invoked. It also drains significant amount of your health when succesfully invoked.<br>
<h3>Communicate</h3>
Invoking this rune allows you to relay a message to all cultists on the station and nearby space objects.
<h3>Stun</h3>
Unlike other runes, this ons is supposed to be used in talisman form. When invoked directly, it simply releases some dark energy, briefly stunning everyone around. When imbued into a talisman, you can force all of its energy into one person, stunning him so hard he cant even speak. However, effect wears off rather fast.<br>
<h3>Equip Armor</h3>
When this rune is invoked, either from a rune or a talisman, it will equip the user with the armor of the followers of Nar-Sie. To use this rune to its fullest extent, make sure you are not wearing any form of headgear, armor, gloves or shoes, and make sure you are not holding anything in your hands.<br>
<h3>See Invisible</h3>
When invoked when standing on it, this rune allows the user to see the the world beyond as long as he does not move.<br>
</body>
</html>
"}
Topic(href,href_list[])
if (src.loc == usr)
var/number = text2num(href_list["number"])
if (usr.stat|| usr.restrained())
return
switch(href_list["action"])
if("clear")
words[words[number]] = words[number]
if("change")
words[words[number]] = input("Enter the translation for [words[number]]", "Word notes") in engwords
for (var/w in words)
if ((words[w] == words[words[number]]) && (w != words[number]))
words[w] = w
notedat = {"
<br><b>Word translation notes</b> <br>
[words[1]] is <a href='byond://?src=\ref[src];number=1;action=change'>[words[words[1]]]</A> <A href='byond://?src=\ref[src];number=1;action=clear'>Clear</A><BR>
[words[2]] is <A href='byond://?src=\ref[src];number=2;action=change'>[words[words[2]]]</A> <A href='byond://?src=\ref[src];number=2;action=clear'>Clear</A><BR>
[words[3]] is <a href='byond://?src=\ref[src];number=3;action=change'>[words[words[3]]]</A> <A href='byond://?src=\ref[src];number=3;action=clear'>Clear</A><BR>
[words[4]] is <a href='byond://?src=\ref[src];number=4;action=change'>[words[words[4]]]</A> <A href='byond://?src=\ref[src];number=4;action=clear'>Clear</A><BR>
[words[5]] is <a href='byond://?src=\ref[src];number=5;action=change'>[words[words[5]]]</A> <A href='byond://?src=\ref[src];number=5;action=clear'>Clear</A><BR>
[words[6]] is <a href='byond://?src=\ref[src];number=6;action=change'>[words[words[6]]]</A> <A href='byond://?src=\ref[src];number=6;action=clear'>Clear</A><BR>
[words[7]] is <a href='byond://?src=\ref[src];number=7;action=change'>[words[words[7]]]</A> <A href='byond://?src=\ref[src];number=7;action=clear'>Clear</A><BR>
[words[8]] is <a href='byond://?src=\ref[src];number=8;action=change'>[words[words[8]]]</A> <A href='byond://?src=\ref[src];number=8;action=clear'>Clear</A><BR>
[words[9]] is <a href='byond://?src=\ref[src];number=9;action=change'>[words[words[9]]]</A> <A href='byond://?src=\ref[src];number=9;action=clear'>Clear</A><BR>
[words[10]] is <a href='byond://?src=\ref[src];number=10;action=change'>[words[words[10]]]</A> <A href='byond://?src=\ref[src];number=10;action=clear'>Clear</A><BR>
"}
usr << browse("[notedat]", "window=notes")
// call(/obj/item/weapon/tome/proc/edit_notes)()
else
usr << browse(null, "window=notes")
return
// proc/edit_notes() FUCK IT. Cant get it to work properly. - K0000
// world << "its been called! [usr]"
// notedat = {"
// <br><b>Word translation notes</b> <br>
// [words[1]] is <a href='byond://?src=\ref[src];number=1;action=change'>[words[words[1]]]</A> <A href='byond://?src=\ref[src];number=1;action=clear'>Clear</A><BR>
// [words[2]] is <A href='byond://?src=\ref[src];number=2;action=change'>[words[words[2]]]</A> <A href='byond://?src=\ref[src];number=2;action=clear'>Clear</A><BR>
// [words[3]] is <a href='byond://?src=\ref[src];number=3;action=change'>[words[words[3]]]</A> <A href='byond://?src=\ref[src];number=3;action=clear'>Clear</A><BR>
// [words[4]] is <a href='byond://?src=\ref[src];number=4;action=change'>[words[words[4]]]</A> <A href='byond://?src=\ref[src];number=4;action=clear'>Clear</A><BR>
// [words[5]] is <a href='byond://?src=\ref[src];number=5;action=change'>[words[words[5]]]</A> <A href='byond://?src=\ref[src];number=5;action=clear'>Clear</A><BR>
// [words[6]] is <a href='byond://?src=\ref[src];number=6;action=change'>[words[words[6]]]</A> <A href='byond://?src=\ref[src];number=6;action=clear'>Clear</A><BR>
// [words[7]] is <a href='byond://?src=\ref[src];number=7;action=change'>[words[words[7]]]</A> <A href='byond://?src=\ref[src];number=7;action=clear'>Clear</A><BR>
// [words[8]] is <a href='byond://?src=\ref[src];number=8;action=change'>[words[words[8]]]</A> <A href='byond://?src=\ref[src];number=8;action=clear'>Clear</A><BR>
// [words[9]] is <a href='byond://?src=\ref[src];number=9;action=change'>[words[words[9]]]</A> <A href='byond://?src=\ref[src];number=9;action=clear'>Clear</A><BR>
// [words[10]] is <a href='byond://?src=\ref[src];number=10;action=change'>[words[words[10]]]</A> <A href='byond://?src=\ref[src];number=10;action=clear'>Clear</A><BR>
// "}
// usr << "whatev"
// usr << browse(null, "window=tank")
attack(mob/living/M as mob, mob/living/user as mob)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had the [name] used on him by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used [name] on [M.name] ([M.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey])</font>")
if(istype(M,/mob/dead))
M.invisibility = 0
user.visible_message( \
"\red [user] drags the ghost to our plan of reality!", \
"\red You drag the ghost to our plan of reality!" \
)
return
if(!istype(M))
return
if(!iscultist(user))
return ..()
if(iscultist(M))
return
M.take_organ_damage(0,rand(5,20)) //really lucky - 5 hits for a crit
for(var/mob/O in viewers(M, null))
O.show_message(text("\red <B>[] beats [] with the arcane tome!</B>", user, M), 1)
M << "\red You feel searing heat inside!"
attack_self(mob/living/user as mob)
usr = user
if(!usr.canmove || usr.stat || usr.restrained())
return
if(!wordtravel)
runerandom()
if(iscultist(user))
var/C = 0
for(var/obj/effect/rune/N in world)
C++
if (!istype(user.loc,/turf))
user << "\red You do not have enough space to write a proper rune."
return
if (C>=26+runedec+ticker.mode.cult.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist
switch(alert("The cloth of reality can't take that much of a strain. By creating another rune, you risk locally tearing reality apart, which would prove fatal to you. Do you still wish to scribe the rune?",,"Yes","No"))
if("Yes")
if(prob(C*5-105-(runedec-ticker.mode.cult.len)*5)) //including the useless rune at the secret room, shouldn't count against the limit - Urist
usr.emote("scream")
user << "\red A tear momentarily appears in reality. Before it closes, you catch a glimpse of that which lies beyond. That proves to be too much for your mind."
usr.gib()
return
if("No")
return
else
switch(alert("You open the tome",,"Read it","Scribe a rune", "Notes")) //Fuck the "Cancel" option. Rewrite the whole tome interface yourself if you want it to work better. And input() is just ugly. - K0000
if("Cancel")
return
if("Read it")
if(usr.get_active_hand() != src)
return
user << browse("[tomedat]", "window=Arcane Tome")
return
if("Notes")
if(usr.get_active_hand() != src)
return
notedat = {"
<br><b>Word translation notes</b> <br>
[words[1]] is <a href='byond://?src=\ref[src];number=1;action=change'>[words[words[1]]]</A> <A href='byond://?src=\ref[src];number=1;action=clear'>Clear</A><BR>
[words[2]] is <A href='byond://?src=\ref[src];number=2;action=change'>[words[words[2]]]</A> <A href='byond://?src=\ref[src];number=2;action=clear'>Clear</A><BR>
[words[3]] is <a href='byond://?src=\ref[src];number=3;action=change'>[words[words[3]]]</A> <A href='byond://?src=\ref[src];number=3;action=clear'>Clear</A><BR>
[words[4]] is <a href='byond://?src=\ref[src];number=4;action=change'>[words[words[4]]]</A> <A href='byond://?src=\ref[src];number=4;action=clear'>Clear</A><BR>
[words[5]] is <a href='byond://?src=\ref[src];number=5;action=change'>[words[words[5]]]</A> <A href='byond://?src=\ref[src];number=5;action=clear'>Clear</A><BR>
[words[6]] is <a href='byond://?src=\ref[src];number=6;action=change'>[words[words[6]]]</A> <A href='byond://?src=\ref[src];number=6;action=clear'>Clear</A><BR>
[words[7]] is <a href='byond://?src=\ref[src];number=7;action=change'>[words[words[7]]]</A> <A href='byond://?src=\ref[src];number=7;action=clear'>Clear</A><BR>
[words[8]] is <a href='byond://?src=\ref[src];number=8;action=change'>[words[words[8]]]</A> <A href='byond://?src=\ref[src];number=8;action=clear'>Clear</A><BR>
[words[9]] is <a href='byond://?src=\ref[src];number=9;action=change'>[words[words[9]]]</A> <A href='byond://?src=\ref[src];number=9;action=clear'>Clear</A><BR>
[words[10]] is <a href='byond://?src=\ref[src];number=10;action=change'>[words[words[10]]]</A> <A href='byond://?src=\ref[src];number=10;action=clear'>Clear</A><BR>
"}
// call(/obj/item/weapon/tome/proc/edit_notes)()
user << browse("[notedat]", "window=notes")
return
if(usr.get_active_hand() != src)
return
var/w1
var/w2
var/w3
var/list/english = list()
for (var/w in words)
english+=words[w]
if(usr)
w1 = input("Write your first rune:", "Rune Scribing") in english
for (var/w in words)
if (words[w] == w1)
w1 = w
if(usr)
w2 = input("Write your second rune:", "Rune Scribing") in english
for (var/w in words)
if (words[w] == w2)
w2 = w
if(usr)
w3 = input("Write your third rune:", "Rune Scribing") in english
for (var/w in words)
if (words[w] == w3)
w3 = w
if(usr.get_active_hand() != src)
return
for (var/mob/V in viewers(src))
V.show_message("\red [user] slices open a finger and begins to chant and paint symbols on the floor.", 3, "\red You hear chanting.", 2)
user << "\red You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world."
user.take_overall_damage(1)
if(do_after(user, 50))
if(usr.get_active_hand() != src)
return
var/mob/living/carbon/human/H = user
var/obj/effect/rune/R = new /obj/effect/rune(user.loc)
user << "\red You finish drawing the arcane markings of the Geometer."
R.word1 = w1
R.word2 = w2
R.word3 = w3
R.check_icon()
R.blood_DNA = list()
R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
return
else
user << "The book seems full of illegible scribbles. Is this a joke?"
return
attackby(obj/item/weapon/tome/T as obj, mob/living/user as mob)
if(istype(T, /obj/item/weapon/tome)) // sanity check to prevent a runtime error
switch(alert("Copy the runes from your tome?",,"Copy", "Cancel"))
if("cancel")
return
// var/list/nearby = viewers(1,src) //- Fuck this as well. No clue why this doesnt work. -K0000
// if (T.loc != user)
// return
// for(var/mob/M in nearby)
// if(M == user)
for(var/w in words)
words[w] = T.words[w]
user << "You copy the translation notes from your tome."
examine()
set src in usr
if(!iscultist(usr))
usr << "An old, dusty tome with frayed edges and a sinister looking cover."
else
usr << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though."
/obj/item/weapon/tome/imbued //admin tome, spawns working runes without waiting
w_class = 2.0
var/cultistsonly = 1
attack_self(mob/user as mob)
if(src.cultistsonly && !iscultist(usr))
return
if(!wordtravel)
runerandom()
if(user)
var/r
if (!istype(user.loc,/turf))
user << "\red You do not have enough space to write a proper rune."
var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun")
r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable.
var/obj/effect/rune/R = new /obj/effect/rune
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
R.blood_DNA = list()
R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
switch(r)
if("teleport")
var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
var/beacon
if(usr)
beacon = input("Select the last rune", "Rune Scribing") in words
R.word1=wordtravel
R.word2=wordself
R.word3=beacon
R.loc = user.loc
R.check_icon()
if("itemport")
var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
var/beacon
if(usr)
beacon = input("Select the last rune", "Rune Scribing") in words
R.word1=wordtravel
R.word2=wordother
R.word3=beacon
R.loc = user.loc
R.check_icon()
if("tome")
R.word1=wordsee
R.word2=wordblood
R.word3=wordhell
R.loc = user.loc
R.check_icon()
if("armor")
R.word1=wordhell
R.word2=worddestr
R.word3=wordother
R.loc = user.loc
R.check_icon()
if("convert")
R.word1=wordjoin
R.word2=wordblood
R.word3=wordself
R.loc = user.loc
R.check_icon()
if("tear in reality")
R.word1=wordhell
R.word2=wordjoin
R.word3=wordself
R.loc = user.loc
R.check_icon()
if("emp")
R.word1=worddestr
R.word2=wordsee
R.word3=wordtech
R.loc = user.loc
R.check_icon()
if("drain")
R.word1=wordtravel
R.word2=wordblood
R.word3=wordself
R.loc = user.loc
R.check_icon()
if("seer")
R.word1=wordsee
R.word2=wordhell
R.word3=wordjoin
R.loc = user.loc
R.check_icon()
if("raise")
R.word1=wordblood
R.word2=wordjoin
R.word3=wordhell
R.loc = user.loc
R.check_icon()
if("obscure")
R.word1=wordhide
R.word2=wordsee
R.word3=wordblood
R.loc = user.loc
R.check_icon()
if("astral journey")
R.word1=wordhell
R.word2=wordtravel
R.word3=wordself
R.loc = user.loc
R.check_icon()
if("manifest")
R.word1=wordblood
R.word2=wordsee
R.word3=wordtravel
R.loc = user.loc
R.check_icon()
if("imbue talisman")
R.word1=wordhell
R.word2=wordtech
R.word3=wordjoin
R.loc = user.loc
R.check_icon()
if("sacrifice")
R.word1=wordhell
R.word2=wordblood
R.word3=wordjoin
R.loc = user.loc
R.check_icon()
if("reveal")
R.word1=wordblood
R.word2=wordsee
R.word3=wordhide
R.loc = user.loc
R.check_icon()
if("wall")
R.word1=worddestr
R.word2=wordtravel
R.word3=wordself
R.loc = user.loc
R.check_icon()
if("freedom")
R.word1=wordtravel
R.word2=wordtech
R.word3=wordother
R.loc = user.loc
R.check_icon()
if("cultsummon")
R.word1=wordjoin
R.word2=wordother
R.word3=wordself
R.loc = user.loc
R.check_icon()
if("deafen")
R.word1=wordhide
R.word2=wordother
R.word3=wordsee
R.loc = user.loc
R.check_icon()
if("blind")
R.word1=worddestr
R.word2=wordsee
R.word3=wordother
R.loc = user.loc
R.check_icon()
if("bloodboil")
R.word1=worddestr
R.word2=wordsee
R.word3=wordblood
R.loc = user.loc
R.check_icon()
if("communicate")
R.word1=wordself
R.word2=wordother
R.word3=wordtech
R.loc = user.loc
R.check_icon()
if("stun")
R.word1=wordjoin
R.word2=wordhide
R.word3=wordtech
R.loc = user.loc
R.check_icon()
/obj/item/weapon/paperscrap
name = "scrap of paper"
icon_state = "scrap"
throw_speed = 1
throw_range = 2
w_class = 1.0
flags = FPRINT | TABLEPASS
var/data
attack_self(mob/user as mob)
view_scrap(user)
examine()
set src in usr
view_scrap(usr)
proc/view_scrap(var/viewer)
viewer << browse(data)

File diff suppressed because it is too large Load Diff

View File

@@ -1,123 +0,0 @@
/obj/item/weapon/paper/talisman
icon_state = "paper_talisman"
var/imbue = null
var/uses = 0
examine()
set src in view(2)
..()
return
attack_self(mob/living/user as mob)
if(iscultist(user))
var/delete = 1
switch(imbue)
if("newtome")
call(/obj/effect/rune/proc/tomesummon)()
if("armor")
call(/obj/effect/rune/proc/armor)()
if("emp")
call(/obj/effect/rune/proc/emp)(usr.loc,3)
if("conceal")
call(/obj/effect/rune/proc/obscure)(2)
if("revealrunes")
call(/obj/effect/rune/proc/revealrunes)(src)
if("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
call(/obj/effect/rune/proc/teleport)(imbue)
if("communicate")
//If the user cancels the talisman this var will be set to 0
delete = call(/obj/effect/rune/proc/communicate)()
if("deafen")
call(/obj/effect/rune/proc/deafen)()
if("blind")
call(/obj/effect/rune/proc/blind)()
if("runestun")
user << "\red To use this talisman, attack your target directly."
return
if("supply")
supply()
user.take_organ_damage(5, 0)
if(src && src.imbue!="supply" && src.imbue!="runestun")
if(delete)
del(src)
return
else
user << "You see strange symbols on the paper. Are they supposed to mean something?"
return
attack(mob/living/carbon/T as mob, mob/living/user as mob)
if(iscultist(user))
if(imbue == "runestun")
user.take_organ_damage(5, 0)
call(/obj/effect/rune/proc/runestun)(T)
del(src)
else
..() ///If its some other talisman, use the generic attack code, is this supposed to work this way?
else
..()
proc/supply(var/key)
if (!src.uses)
del(src)
return
var/dat = "<B>There are [src.uses] bloody runes on the parchment.</B><BR>"
dat += "Please choose the chant to be imbued into the fabric of reality.<BR>"
dat += "<HR>"
dat += "<A href='?src=\ref[src];rune=newtome'>N'ath reth sh'yro eth d'raggathnor!</A> - Allows you to summon a new arcane tome.<BR>"
dat += "<A href='?src=\ref[src];rune=teleport'>Sas'so c'arta forbici!</A> - Allows you to move to a rune with the same last word.<BR>"
dat += "<A href='?src=\ref[src];rune=emp'>Ta'gh fara'qha fel d'amar det!</A> - Allows you to destroy technology in a short range.<BR>"
dat += "<A href='?src=\ref[src];rune=conceal'>Kla'atu barada nikt'o!</A> - Allows you to conceal the runes you placed on the floor.<BR>"
dat += "<A href='?src=\ref[src];rune=communicate'>O bidai nabora se'sma!</A> - Allows you to coordinate with others of your cult.<BR>"
dat += "<A href='?src=\ref[src];rune=runestun'>Fuu ma'jin</A> - Allows you to stun a person by attacking them with the talisman.<BR>"
dat += "<A href='?src=\ref[src];rune=armor'>Sa tatha najin</A> - Allows you to summon armoured robes and an unholy blade<BR>"
dat += "<A href='?src=\ref[src];rune=soulstone'>Kal om neth</A> - Summons a soul stone<BR>"
dat += "<A href='?src=\ref[src];rune=construct'>Da A'ig Osk</A> - Summons a construct shell for use with captured souls. It is too large to carry on your person.<BR>"
usr << browse(dat, "window=id_com;size=350x200")
return
Topic(href, href_list)
if(!src) return
if (usr.stat || usr.restrained() || !in_range(src, usr)) return
if (href_list["rune"])
switch(href_list["rune"])
if("newtome")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "newtome"
if("teleport")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "[pick("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri", "orkan", "allaq")]"
T.info = "[T.imbue]"
if("emp")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "emp"
if("conceal")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "conceal"
if("communicate")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "communicate"
if("runestun")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "runestun"
if("armor")
var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
T.imbue = "armor"
if("soulstone")
new /obj/item/device/soulstone(get_turf(usr))
if("construct")
new /obj/structure/constructshell(get_turf(usr))
src.uses--
supply()
return
/obj/item/weapon/paper/talisman/supply
imbue = "supply"
uses = 5

View File

@@ -1,780 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
//*******************************
//
// Library SQL Configuration
//
//*******************************
// Deprecated! See global.dm for new SQL config vars -- TLE
/*
#define SQL_ADDRESS ""
#define SQL_DB ""
#define SQL_PORT "3306"
#define SQL_LOGIN ""
#define SQL_PASS ""
*/
//*******************************
// Requires Dantom.DB library ( http://www.byond.com/developer/Dantom/DB )
/*
The Library
------------
A place for the crew to go, relax, and enjoy a good book.
Aspiring authors can even self publish and, if they're lucky
convince the on-staff Librarian to submit it to the Archives
to be chronicled in history forever - some say even persisting
through alternate dimensions.
Written by TLE for /tg/station 13
Feel free to use this as you like. Some credit would be cool.
Check us out at http://nanotrasen.com/ if you're so inclined.
*/
// CONTAINS:
// Objects:
// - bookcase
// - book
// - barcode scanner
// Machinery:
// - library computer
// - visitor's computer
// - book binder
// - book scanner
// Datum:
// - borrowbook
// Ideas for the future
// ---------------------
// - Visitor's computer should be able to search the current in-round library inventory (that the Librarian has stocked and checked in)
// -- Give computer other features like an Instant Messenger application, or the ability to edit, save, and print documents.
// - Admin interface directly tied to the Archive DB. Right now there's no way to delete uploaded books in-game.
// -- If this gets implemented, allow Librarians to "tag" or "suggest" books to be deleted. The DB ID of the tagged books gets saved to a text file (or another table in the DB maybe?).
// The admin interface would automatically take these IDs and SELECT them all from the DB to be displayed along with a Delete link to drop the row from the table.
// - When the game sets up and the round begins, have it automatically pick random books from the DB to populate the library with. Even if the Librarian is a useless fuck there are at least a few books around.
// - Allow books to be "hollowed out" like the Chaplain's Bible, allowing you to store one pocket-sized item inside.
// - Make books/book cases burn when exposed to flame.
// - Make book binder hackable.
// - Books shouldn't print straight from the library computer. Make it synch with a machine like the book binder to print instead. This should consume some sort of resource.
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
/proc/sanitizeSQL(var/t as text)
var/sanitized_text = dd_replacetext(t, "'", "\\'")
sanitized_text = dd_replacetext(sanitized_text, "\"", "\\\"")
return sanitized_text
/obj/structure/bookcase
name = "bookcase"
icon = 'icons/obj/library.dmi'
icon_state = "book-0"
anchored = 1
density = 1
opacity = 1
/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/book))
user.drop_item()
O.loc = src
update_icon()
else if(istype(O, /obj/item/weapon/pen))
var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_MESSAGE_LEN)
if(!newname)
return
else
name = ("bookcase ([sanitize(newname)])")
else
..()
/obj/structure/bookcase/attack_hand(var/mob/user as mob)
if(contents.len)
var/obj/item/weapon/book/choice = input("Which book would you like to remove from the shelf?") in contents as obj|null
if(choice)
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
return
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(choice)
else
choice.loc = get_turf(src)
update_icon()
/obj/structure/bookcase/ex_act(severity)
switch(severity)
if(1.0)
for(var/obj/item/weapon/book/b in contents)
del(b)
del(src)
return
if(2.0)
for(var/obj/item/weapon/book/b in contents)
if (prob(50)) b.loc = (get_turf(src))
else del(b)
del(src)
return
if(3.0)
if (prob(50))
for(var/obj/item/weapon/book/b in contents)
b.loc = (get_turf(src))
del(src)
return
else
return
/obj/structure/bookcase/update_icon()
if(contents.len < 5)
icon_state = "book-[contents.len]"
else
icon_state = "book-5"
/obj/structure/bookcase/manuals/medical
name = "Medical Manuals bookcase"
New()
..()
new /obj/item/weapon/book/manual/medical_cloning(src)
update_icon()
/obj/structure/bookcase/manuals/engineering
name = "Engineering Manuals bookcase"
New()
..()
new /obj/item/weapon/book/manual/engineering_construction(src)
new /obj/item/weapon/book/manual/engineering_particle_accelerator(src)
new /obj/item/weapon/book/manual/engineering_hacking(src)
new /obj/item/weapon/book/manual/engineering_guide(src)
new /obj/item/weapon/book/manual/engineering_singularity_safety(src)
new /obj/item/weapon/book/manual/robotics_cyborgs(src)
update_icon()
/obj/structure/bookcase/manuals/research_and_development
name = "R&D Manuals bookcase"
New()
..()
new /obj/item/weapon/book/manual/research_and_development(src)
update_icon()
/obj/item/weapon/book
name = "book"
icon = 'icons/obj/library.dmi'
icon_state ="book"
throw_speed = 1
throw_range = 5
w_class = 1.0
flags = FPRINT | TABLEPASS
attack_verb = list("bashed", "whacked", "educated")
var/dat // Actual page content
var/due_date = 0 // Game time in 1/10th seconds
var/author // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
var/unique = 0 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified
var/title // The real name of the book.
/obj/item/weapon/book/attack_self(var/mob/user as mob)
if(src.dat)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book")
user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.")
onclose(user, "book")
else
user << "This book is completely blank!"
/obj/item/weapon/book/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen))
if(unique)
user << "These pages don't seem to take the ink well. Looks like you can't modify it."
return
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
var/newtitle = copytext(reject_bad_text(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN)
if(!newtitle)
usr << "The title is invalid."
return
else
src.name = newtitle
src.title = newtitle
if("Contents")
var/content = strip_html(input("Write your book's contents (HTML NOT allowed):"),8192) as message|null
if(!content)
usr << "The content is invalid."
return
else
src.dat += content
if("Author")
var/newauthor = copytext(sanitize(input("Write the author's name:") as text|null),1,MAX_NAME_LEN)
if(!newauthor)
usr << "The name is invalid."
return
else
src.author = newauthor
else
return
else if(istype(W, /obj/item/weapon/barcodescanner))
var/obj/item/weapon/barcodescanner/scanner = W
if(!scanner.computer)
user << "[W]'s screen flashes: 'No associated computer found!'"
else
switch(scanner.mode)
if(0)
scanner.book = src
user << "[W]'s screen flashes: 'Book stored in buffer.'"
if(1)
scanner.book = src
scanner.computer.buffer_book = src.name
user << "[W]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'"
if(2)
scanner.book = src
for(var/datum/borrowbook/b in scanner.computer.checkouts)
if(b.bookname == src.name)
scanner.computer.checkouts.Remove(b)
user << "[W]'s screen flashes: 'Book stored in buffer. Book has been checked in.'"
return
user << "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'"
if(3)
scanner.book = src
for(var/obj/item/weapon/book in scanner.computer.inventory)
if(book == src)
user << "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'"
return
scanner.computer.inventory.Add(src)
user << "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'"
else
..()
/obj/item/weapon/barcodescanner
name = "barcode scanner"
icon = 'icons/obj/library.dmi'
icon_state ="scanner"
throw_speed = 1
throw_range = 5
w_class = 1.0
flags = FPRINT | TABLEPASS
var/obj/machinery/librarycomp/computer // Associated computer - Modes 1 to 3 use this
var/obj/item/weapon/book/book // Currently scanned book
var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory
attack_self(mob/user as mob)
mode += 1
if(mode > 3)
mode = 0
user << "[src] Status Display:"
var/modedesc
switch(mode)
if(0)
modedesc = "Scan book to local buffer."
if(1)
modedesc = "Scan book to local buffer and set associated computer buffer to match."
if(2)
modedesc = "Scan book to local buffer, attempt to check in scanned book."
if(3)
modedesc = "Scan book to local buffer, attempt to add book to general inventory."
else
modedesc = "ERROR"
user << " - Mode [mode] : [modedesc]"
if(src.computer)
user << "<font color=green>Computer has been associated with this unit.</font>"
else
user << "<font color=red>No associated computer found. Only local scans will function properly.</font>"
user << "\n"
datum/borrowbook // Datum used to keep track of who has borrowed what when and for how long.
var/bookname
var/mobname
var/getdate
var/duedate
/obj/machinery/librarypubliccomp
name = "visitor computer"
icon = 'icons/obj/library.dmi'
icon_state = "computer"
anchored = 1
density = 1
var/screenstate = 0
var/title
var/category = "Any"
var/author
var/SQLquery
/obj/machinery/librarypubliccomp/attack_hand(var/mob/user as mob)
usr.machine = src
var/dat = "<HEAD><TITLE>Library Visitor</TITLE></HEAD><BODY>\n" // <META HTTP-EQUIV='Refresh' CONTENT='10'>
switch(screenstate)
if(0)
dat += "<h2>Search Settings</h2><br>"
dat += "<A href='?src=\ref[src];settitle=1'>Filter by Title: [title]</A><BR>"
dat += "<A href='?src=\ref[src];setcategory=1'>Filter by Category: [category]</A><BR>"
dat += "<A href='?src=\ref[src];setauthor=1'>Filter by Author: [author]</A><BR>"
dat += "<A href='?src=\ref[src];search=1'>\[Start Search\]</A><BR>"
if(1)
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font><BR>"
else if(!SQLquery)
dat += "<font color=red><b>ERROR</b>: Malformed search request. Please contact your system administrator for assistance.</font><BR>"
else
dat += "<table>"
dat += "<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td>SS<sup>13</sup>BN</td></tr>"
var/DBQuery/query = dbcon.NewQuery(SQLquery)
query.Execute()
while(query.NextRow())
var/author = query.item[1]
var/title = query.item[2]
var/category = query.item[3]
var/id = query.item[4]
dat += "<tr><td>[author]</td><td>[title]</td><td>[category]</td><td>[id]</td></tr>"
dat += "</table><BR>"
dbcon.Disconnect()
dat += "<A href='?src=\ref[src];back=1'>\[Go Back\]</A><BR>"
user << browse(dat, "window=publiclibrary")
onclose(user, "publiclibrary")
/obj/machinery/librarypubliccomp/Topic(href, href_list)
if(..())
usr << browse(null, "window=publiclibrary")
onclose(usr, "publiclibrary")
return
if(href_list["settitle"])
var/newtitle = input("Enter a title to search for:") as text|null
if(newtitle)
title = sanitize(newtitle)
else
title = null
title = sanitizeSQL(title)
if(href_list["setcategory"])
var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory)
category = sanitize(newcategory)
else
category = "Any"
category = sanitizeSQL(category)
if(href_list["setauthor"])
var/newauthor = input("Enter an author to search for:") as text|null
if(newauthor)
author = sanitize(newauthor)
else
author = null
author = sanitizeSQL(author)
if(href_list["search"])
SQLquery = "SELECT author, title, category, id FROM library WHERE "
if(category == "Any")
SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%'"
else
SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%' AND category='[category]'"
screenstate = 1
if(href_list["back"])
screenstate = 0
src.add_fingerprint(usr)
src.updateUsrDialog()
return
// TODO: Make this an actual /obj/machinery/computer that can be crafted from circuit boards and such
/obj/machinery/librarycomp
name = "Check-In/Out Computer"
icon = 'icons/obj/library.dmi'
icon_state = "computer"
anchored = 1
density = 1
var/arcanecheckout = 0
var/screenstate = 0 // 0 - Main Menu, 1 - Inventory, 2 - Checked Out, 3 - Check Out a Book
var/buffer_book
var/buffer_mob
var/upload_category = "Fiction"
var/list/checkouts = list()
var/list/inventory = list()
var/checkoutperiod = 5 // In minutes
var/obj/machinery/libraryscanner/scanner // Book scanner that will be used when uploading books to the Archive
var/bibledelay = 0 // LOL NO SPAM (1 minute delay) -- Doohl
/obj/machinery/librarycomp/attack_hand(var/mob/user as mob)
usr.machine = src
var/dat = "<HEAD><TITLE>Book Inventory Management</TITLE></HEAD><BODY>\n" // <META HTTP-EQUIV='Refresh' CONTENT='10'>
switch(screenstate)
if(0)
// Main Menu
dat += "<A href='?src=\ref[src];switchscreen=1'>1. View General Inventory</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=2'>2. View Checked Out Inventory</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=3'>3. Check out a Book</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=4'>4. Connect to External Archive</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=5'>5. Upload New Title to Archive</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=6'>6. Print a Bible</A><BR>"
if(src.emagged)
dat += "<A href='?src=\ref[src];switchscreen=7'>7. Access the Forbidden Lore Vault</A><BR>"
if(src.arcanecheckout)
new /obj/item/weapon/tome(src.loc)
user << "<span class='warning'>Your sanity barely endures the seconds spent in the vault's browsing window. The only thing to remind you of this when you stop browsing is a dusty old tome sitting on the desk. You don't really remember printing it.</span>"
user.visible_message("[user] stares at the blank screen for a few moments, his expression frozen in fear. When he finally awakens from it, he looks a lot older.", 2)
src.arcanecheckout = 0
if(1)
// Inventory
dat += "<H3>Inventory</H3><BR>"
for(var/obj/item/weapon/book/b in inventory)
dat += "[b.name] <A href='?src=\ref[src];delbook=\ref[b]'>(Delete)</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=0'>(Return to main menu)</A><BR>"
if(2)
// Checked Out
dat += "<h3>Checked Out Books</h3><BR>"
for(var/datum/borrowbook/b in checkouts)
var/timetaken = world.time - b.getdate
//timetaken *= 10
timetaken /= 600
timetaken = round(timetaken)
var/timedue = b.duedate - world.time
//timedue *= 10
timedue /= 600
if(timedue <= 0)
timedue = "<font color=red><b>(OVERDUE)</b> [timedue]</font>"
else
timedue = round(timedue)
dat += "\"[b.bookname]\", Checked out to: [b.mobname]<BR>--- Taken: [timetaken] minutes ago, Due: in [timedue] minutes<BR>"
dat += "<A href='?src=\ref[src];checkin=\ref[b]'>(Check In)</A><BR><BR>"
dat += "<A href='?src=\ref[src];switchscreen=0'>(Return to main menu)</A><BR>"
if(3)
// Check Out a Book
dat += "<h3>Check Out a Book</h3><BR>"
dat += "Book: [src.buffer_book] "
dat += "<A href='?src=\ref[src];editbook=1'>\[Edit\]</A><BR>"
dat += "Recipient: [src.buffer_mob] "
dat += "<A href='?src=\ref[src];editmob=1'>\[Edit\]</A><BR>"
dat += "Checkout Date : [world.time/600]<BR>"
dat += "Due Date: [(world.time + checkoutperiod)/600]<BR>"
dat += "(Checkout Period: [checkoutperiod] minutes) (<A href='?src=\ref[src];increasetime=1'>+</A>/<A href='?src=\ref[src];decreasetime=1'>-</A>)"
dat += "<A href='?src=\ref[src];checkout=1'>(Commit Entry)</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=0'>(Return to main menu)</A><BR>"
if(4)
dat += "<h3>External Archive</h3>"
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font>"
else
dat += "<A href='?src=\ref[src];orderbyid=1'>(Order book by SS<sup>13</sup>BN)</A><BR><BR>"
dat += "<table>"
dat += "<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td></td></tr>"
var/DBQuery/query = dbcon.NewQuery("SELECT id, author, title, category FROM library")
query.Execute()
while(query.NextRow())
var/id = query.item[1]
var/author = query.item[2]
var/title = query.item[3]
var/category = query.item[4]
dat += "<tr><td>[author]</td><td>[title]</td><td>[category]</td><td><A href='?src=\ref[src];targetid=[id]'>\[Order\]</A></td></tr>"
dat += "</table>"
dat += "<BR><A href='?src=\ref[src];switchscreen=0'>(Return to main menu)</A><BR>"
dbcon.Disconnect()
if(5)
dat += "<H3>Upload a New Title</H3>"
if(!scanner)
for(var/obj/machinery/libraryscanner/S in range(9))
scanner = S
break
if(!scanner)
dat += "<FONT color=red>No scanner found within wireless network range.</FONT><BR>"
else if(!scanner.cache)
dat += "<FONT color=red>No data found in scanner memory.</FONT><BR>"
else
dat += "<TT>Data marked for upload...</TT><BR>"
dat += "<TT>Title: </TT>[scanner.cache.name]<BR>"
if(!scanner.cache.author)
scanner.cache.author = "Anonymous"
dat += "<TT>Author: </TT><A href='?src=\ref[src];setauthor=1'>[scanner.cache.author]</A><BR>"
dat += "<TT>Category: </TT><A href='?src=\ref[src];setcategory=1'>[upload_category]</A><BR>"
dat += "<A href='?src=\ref[src];upload=1'>\[Upload\]</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=0'>(Return to main menu)</A><BR>"
if(7)
dat += "<h3>Accessing Forbidden Lore Vault v 1.3</h3>"
dat += "Are you absolutely sure you want to proceed? EldritchTomes Inc. takes no responsibilities for loss of sanity resulting from this action.<p>"
dat += "<A href='?src=\ref[src];arccheckout=1'>Yes.</A><BR>"
dat += "<A href='?src=\ref[src];switchscreen=0'>No.</A><BR>"
//dat += "<A HREF='?src=\ref[user];mach_close=library'>Close</A><br><br>"
user << browse(dat, "window=library")
onclose(user, "library")
/obj/machinery/librarycomp/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (src.density && istype(W, /obj/item/weapon/card/emag))
src.emagged = 1
if(istype(W, /obj/item/weapon/barcodescanner))
var/obj/item/weapon/barcodescanner/scanner = W
scanner.computer = src
user << "[scanner]'s associated machine has been set to [src]."
for (var/mob/V in hearers(src))
V.show_message("[src] lets out a low, short blip.", 2)
else
..()
/obj/machinery/librarycomp/Topic(href, href_list)
if(..())
usr << browse(null, "window=library")
onclose(usr, "library")
return
if(href_list["switchscreen"])
switch(href_list["switchscreen"])
if("0")
screenstate = 0
if("1")
screenstate = 1
if("2")
screenstate = 2
if("3")
screenstate = 3
if("4")
screenstate = 4
if("5")
screenstate = 5
if("6")
if(!bibledelay)
var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible(src.loc)
if(ticker && ( ticker.Bible_icon_state && ticker.Bible_item_state) )
B.icon_state = ticker.Bible_icon_state
B.item_state = ticker.Bible_item_state
B.name = ticker.Bible_name
B.deity_name = ticker.Bible_deity_name
bibledelay = 1
spawn(60)
bibledelay = 0
else
for (var/mob/V in hearers(src))
V.show_message("<b>[src]</b>'s monitor flashes, \"Bible printer currently unavailable, please wait a moment.\"")
if("7")
screenstate = 7
if(href_list["arccheckout"])
if(src.emagged)
src.arcanecheckout = 1
src.screenstate = 0
if(href_list["increasetime"])
checkoutperiod += 1
if(href_list["decreasetime"])
checkoutperiod -= 1
if(checkoutperiod < 1)
checkoutperiod = 1
if(href_list["editbook"])
buffer_book = copytext(sanitize(input("Enter the book's title:") as text|null),1,MAX_MESSAGE_LEN)
if(href_list["editmob"])
buffer_mob = copytext(sanitize(input("Enter the recipient's name:") as text|null),1,MAX_NAME_LEN)
if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book)
b.mobname = sanitize(buffer_mob)
b.getdate = world.time
b.duedate = world.time + (checkoutperiod * 600)
checkouts.Add(b)
if(href_list["checkin"])
var/datum/borrowbook/b = locate(href_list["checkin"])
checkouts.Remove(b)
if(href_list["delbook"])
var/obj/item/weapon/book/b = locate(href_list["delbook"])
inventory.Remove(b)
if(href_list["setauthor"])
var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN)
if(newauthor)
scanner.cache.author = newauthor
if(href_list["setcategory"])
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory)
upload_category = newcategory
if(href_list["upload"])
if(scanner)
if(scanner.cache)
var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort")
if(choice == "Confirm")
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
alert("Connection to Archive has been severed. Aborting.")
else
/*
var/sqltitle = dbcon.Quote(scanner.cache.name)
var/sqlauthor = dbcon.Quote(scanner.cache.author)
var/sqlcontent = dbcon.Quote(scanner.cache.dat)
var/sqlcategory = dbcon.Quote(upload_category)
*/
var/sqltitle = sanitizeSQL(scanner.cache.name)
var/sqlauthor = sanitizeSQL(scanner.cache.author)
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
var/sqlcategory = sanitizeSQL(upload_category)
var/DBQuery/query = dbcon.NewQuery("INSERT INTO library (author, title, content, category) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]')")
if(!query.Execute())
usr << query.ErrorMsg()
else
log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs")
alert("Upload Complete.")
dbcon.Disconnect()
if(href_list["targetid"])
var/sqlid = sanitizeSQL(href_list["targetid"])
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
alert("Connection to Archive has been severed. Aborting.")
if(bibledelay)
for (var/mob/V in hearers(src))
V.show_message("<b>[src]</b>'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
else
bibledelay = 1
spawn(60)
bibledelay = 0
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM library WHERE id=[sqlid]")
query.Execute()
while(query.NextRow())
var/author = query.item[2]
var/title = query.item[3]
var/content = query.item[4]
var/obj/item/weapon/book/B = new(src.loc)
B.name = "Book: [title]"
B.title = title
B.author = author
B.dat = content
B.icon_state = "book[rand(1,7)]"
src.visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?")
break
dbcon.Disconnect()
if(href_list["orderbyid"])
var/orderid = input("Enter your order:") as num|null
if(orderid)
if(isnum(orderid))
var/nhref = "src=\ref[src];targetid=[orderid]"
spawn() src.Topic(nhref, params2list(nhref), src)
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/obj/machinery/libraryscanner
name = "scanner"
icon = 'icons/obj/library.dmi'
icon_state = "bigscanner"
anchored = 1
density = 1
var/obj/item/weapon/book/cache // Last scanned book
/obj/machinery/libraryscanner/attackby(var/obj/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/book))
user.drop_item()
O.loc = src
/obj/machinery/libraryscanner/attack_hand(var/mob/user as mob)
usr.machine = src
var/dat = "<HEAD><TITLE>Scanner Control Interface</TITLE></HEAD><BODY>\n" // <META HTTP-EQUIV='Refresh' CONTENT='10'>
if(cache)
dat += "<FONT color=#005500>Data stored in memory.</FONT><BR>"
else
dat += "No data stored in memory.<BR>"
dat += "<A href='?src=\ref[src];scan=1'>\[Scan\]</A>"
if(cache)
dat += " <A href='?src=\ref[src];clear=1'>\[Clear Memory\]</A><BR><BR><A href='?src=\ref[src];eject=1'>\[Remove Book\]</A>"
else
dat += "<BR>"
user << browse(dat, "window=scanner")
onclose(user, "scanner")
/obj/machinery/libraryscanner/Topic(href, href_list)
if(..())
usr << browse(null, "window=scanner")
onclose(usr, "scanner")
return
if(href_list["scan"])
for(var/obj/item/weapon/book/B in contents)
cache = B
break
if(href_list["clear"])
cache = null
if(href_list["eject"])
for(var/obj/item/weapon/book/B in contents)
B.loc = src.loc
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/obj/machinery/bookbinder
name = "Book Binder"
icon = 'icons/obj/library.dmi'
icon_state = "binder"
anchored = 1
density = 1
/obj/machinery/bookbinder/attackby(var/obj/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
user.drop_item()
O.loc = src
user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].")
src.visible_message("[src] begins to hum as it warms up its printing drums.")
sleep(rand(200,400))
src.visible_message("[src] whirs as it prints and binds a new book.")
var/obj/item/weapon/book/b = new(src.loc)
b.dat = O:info
b.name = "Print Job #" + "[rand(100, 999)]"
b.icon_state = "book[rand(1,7)]"
del(O)
else
..()

View File

@@ -1,587 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/datum/song
var/name = "Untitled"
var/list/lines = new()
var/tempo = 5
/obj/structure/device/piano
name = "space minimoog"
icon = 'icons/obj/musician.dmi'
icon_state = "minimoog"
anchored = 1
density = 1
var/datum/song/song
var/playing = 0
var/help = 0
var/edit = 1
var/repeat = 0
proc
playnote(var/note as text)
//world << "Note: [note]"
var/soundfile
/*BYOND loads resource files at compile time if they are ''. This means you can't really manipulate them dynamically.
Tried doing it dynamically at first but its more trouble than its worth. Would have saved many lines tho.*/
switch(note)
if("Cn1")
soundfile = 'sound/piano/Cn1.ogg'
if("C#1")
soundfile = 'sound/piano/C#1.ogg'
if("Db1")
soundfile = 'sound/piano/Db1.ogg'
if("Dn1")
soundfile = 'sound/piano/Dn1.ogg'
if("D#1")
soundfile = 'sound/piano/D#1.ogg'
if("Eb1")
soundfile = 'sound/piano/Eb1.ogg'
if("En1")
soundfile = 'sound/piano/En1.ogg'
if("E#1")
soundfile = 'sound/piano/E#1.ogg'
if("Fb1")
soundfile = 'sound/piano/Fb1.ogg'
if("Fn1")
soundfile = 'sound/piano/Fn1.ogg'
if("F#1")
soundfile = 'sound/piano/F#1.ogg'
if("Gb1")
soundfile = 'sound/piano/Gb1.ogg'
if("Gn1")
soundfile = 'sound/piano/Gn1.ogg'
if("G#1")
soundfile = 'sound/piano/G#1.ogg'
if("Ab1")
soundfile = 'sound/piano/Ab1.ogg'
if("An1")
soundfile = 'sound/piano/An1.ogg'
if("A#1")
soundfile = 'sound/piano/A#1.ogg'
if("Bb1")
soundfile = 'sound/piano/Bb1.ogg'
if("Bn1")
soundfile = 'sound/piano/Bn1.ogg'
if("B#1")
soundfile = 'sound/piano/B#1.ogg'
if("Cb2")
soundfile = 'sound/piano/Cb2.ogg'
if("Cn2")
soundfile = 'sound/piano/Cn2.ogg'
if("C#2")
soundfile = 'sound/piano/C#2.ogg'
if("Db2")
soundfile = 'sound/piano/Db2.ogg'
if("Dn2")
soundfile = 'sound/piano/Dn2.ogg'
if("D#2")
soundfile = 'sound/piano/D#2.ogg'
if("Eb2")
soundfile = 'sound/piano/Eb2.ogg'
if("En2")
soundfile = 'sound/piano/En2.ogg'
if("E#2")
soundfile = 'sound/piano/E#2.ogg'
if("Fb2")
soundfile = 'sound/piano/Fb2.ogg'
if("Fn2")
soundfile = 'sound/piano/Fn2.ogg'
if("F#2")
soundfile = 'sound/piano/F#2.ogg'
if("Gb2")
soundfile = 'sound/piano/Gb2.ogg'
if("Gn2")
soundfile = 'sound/piano/Gn2.ogg'
if("G#2")
soundfile = 'sound/piano/G#2.ogg'
if("Ab2")
soundfile = 'sound/piano/Ab2.ogg'
if("An2")
soundfile = 'sound/piano/An2.ogg'
if("A#2")
soundfile = 'sound/piano/A#2.ogg'
if("Bb2")
soundfile = 'sound/piano/Bb2.ogg'
if("Bn2")
soundfile = 'sound/piano/Bn2.ogg'
if("B#2")
soundfile = 'sound/piano/B#2.ogg'
if("Cb3")
soundfile = 'sound/piano/Cb3.ogg'
if("Cn3")
soundfile = 'sound/piano/Cn3.ogg'
if("C#3")
soundfile = 'sound/piano/C#3.ogg'
if("Db3")
soundfile = 'sound/piano/Db3.ogg'
if("Dn3")
soundfile = 'sound/piano/Dn3.ogg'
if("D#3")
soundfile = 'sound/piano/D#3.ogg'
if("Eb3")
soundfile = 'sound/piano/Eb3.ogg'
if("En3")
soundfile = 'sound/piano/En3.ogg'
if("E#3")
soundfile = 'sound/piano/E#3.ogg'
if("Fb3")
soundfile = 'sound/piano/Fb3.ogg'
if("Fn3")
soundfile = 'sound/piano/Fn3.ogg'
if("F#3")
soundfile = 'sound/piano/F#3.ogg'
if("Gb3")
soundfile = 'sound/piano/Gb3.ogg'
if("Gn3")
soundfile = 'sound/piano/Gn3.ogg'
if("G#3")
soundfile = 'sound/piano/G#3.ogg'
if("Ab3")
soundfile = 'sound/piano/Ab3.ogg'
if("An3")
soundfile = 'sound/piano/An3.ogg'
if("A#3")
soundfile = 'sound/piano/A#3.ogg'
if("Bb3")
soundfile = 'sound/piano/Bb3.ogg'
if("Bn3")
soundfile = 'sound/piano/Bn3.ogg'
if("B#3")
soundfile = 'sound/piano/B#3.ogg'
if("Cb4")
soundfile = 'sound/piano/Cb4.ogg'
if("Cn4")
soundfile = 'sound/piano/Cn4.ogg'
if("C#4")
soundfile = 'sound/piano/C#4.ogg'
if("Db4")
soundfile = 'sound/piano/Db4.ogg'
if("Dn4")
soundfile = 'sound/piano/Dn4.ogg'
if("D#4")
soundfile = 'sound/piano/D#4.ogg'
if("Eb4")
soundfile = 'sound/piano/Eb4.ogg'
if("En4")
soundfile = 'sound/piano/En4.ogg'
if("E#4")
soundfile = 'sound/piano/E#4.ogg'
if("Fb4")
soundfile = 'sound/piano/Fb4.ogg'
if("Fn4")
soundfile = 'sound/piano/Fn4.ogg'
if("F#4")
soundfile = 'sound/piano/F#4.ogg'
if("Gb4")
soundfile = 'sound/piano/Gb4.ogg'
if("Gn4")
soundfile = 'sound/piano/Gn4.ogg'
if("G#4")
soundfile = 'sound/piano/G#4.ogg'
if("Ab4")
soundfile = 'sound/piano/Ab4.ogg'
if("An4")
soundfile = 'sound/piano/An4.ogg'
if("A#4")
soundfile = 'sound/piano/A#4.ogg'
if("Bb4")
soundfile = 'sound/piano/Bb4.ogg'
if("Bn4")
soundfile = 'sound/piano/Bn4.ogg'
if("B#4")
soundfile = 'sound/piano/B#4.ogg'
if("Cb5")
soundfile = 'sound/piano/Cb5.ogg'
if("Cn5")
soundfile = 'sound/piano/Cn5.ogg'
if("C#5")
soundfile = 'sound/piano/C#5.ogg'
if("Db5")
soundfile = 'sound/piano/Db5.ogg'
if("Dn5")
soundfile = 'sound/piano/Dn5.ogg'
if("D#5")
soundfile = 'sound/piano/D#5.ogg'
if("Eb5")
soundfile = 'sound/piano/Eb5.ogg'
if("En5")
soundfile = 'sound/piano/En5.ogg'
if("E#5")
soundfile = 'sound/piano/E#5.ogg'
if("Fb5")
soundfile = 'sound/piano/Fb5.ogg'
if("Fn5")
soundfile = 'sound/piano/Fn5.ogg'
if("F#5")
soundfile = 'sound/piano/F#5.ogg'
if("Gb5")
soundfile = 'sound/piano/Gb5.ogg'
if("Gn5")
soundfile = 'sound/piano/Gn5.ogg'
if("G#5")
soundfile = 'sound/piano/G#5.ogg'
if("Ab5")
soundfile = 'sound/piano/Ab5.ogg'
if("An5")
soundfile = 'sound/piano/An5.ogg'
if("A#5")
soundfile = 'sound/piano/A#5.ogg'
if("Bb5")
soundfile = 'sound/piano/Bb5.ogg'
if("Bn5")
soundfile = 'sound/piano/Bn5.ogg'
if("B#5")
soundfile = 'sound/piano/B#5.ogg'
if("Cb6")
soundfile = 'sound/piano/Cb6.ogg'
if("Cn6")
soundfile = 'sound/piano/Cn6.ogg'
if("C#6")
soundfile = 'sound/piano/C#6.ogg'
if("Db6")
soundfile = 'sound/piano/Db6.ogg'
if("Dn6")
soundfile = 'sound/piano/Dn6.ogg'
if("D#6")
soundfile = 'sound/piano/D#6.ogg'
if("Eb6")
soundfile = 'sound/piano/Eb6.ogg'
if("En6")
soundfile = 'sound/piano/En6.ogg'
if("E#6")
soundfile = 'sound/piano/E#6.ogg'
if("Fb6")
soundfile = 'sound/piano/Fb6.ogg'
if("Fn6")
soundfile = 'sound/piano/Fn6.ogg'
if("F#6")
soundfile = 'sound/piano/F#6.ogg'
if("Gb6")
soundfile = 'sound/piano/Gb6.ogg'
if("Gn6")
soundfile = 'sound/piano/Gn6.ogg'
if("G#6")
soundfile = 'sound/piano/G#6.ogg'
if("Ab6")
soundfile = 'sound/piano/Ab6.ogg'
if("An6")
soundfile = 'sound/piano/An6.ogg'
if("A#6")
soundfile = 'sound/piano/A#6.ogg'
if("Bb6")
soundfile = 'sound/piano/Bb6.ogg'
if("Bn6")
soundfile = 'sound/piano/Bn6.ogg'
if("B#6")
soundfile = 'sound/piano/B#6.ogg'
if("Cb7")
soundfile = 'sound/piano/Cb7.ogg'
if("Cn7")
soundfile = 'sound/piano/Cn7.ogg'
if("C#7")
soundfile = 'sound/piano/C#7.ogg'
if("Db7")
soundfile = 'sound/piano/Db7.ogg'
if("Dn7")
soundfile = 'sound/piano/Dn7.ogg'
if("D#7")
soundfile = 'sound/piano/D#7.ogg'
if("Eb7")
soundfile = 'sound/piano/Eb7.ogg'
if("En7")
soundfile = 'sound/piano/En7.ogg'
if("E#7")
soundfile = 'sound/piano/E#7.ogg'
if("Fb7")
soundfile = 'sound/piano/Fb7.ogg'
if("Fn7")
soundfile = 'sound/piano/Fn7.ogg'
if("F#7")
soundfile = 'sound/piano/F#7.ogg'
if("Gb7")
soundfile = 'sound/piano/Gb7.ogg'
if("Gn7")
soundfile = 'sound/piano/Gn7.ogg'
if("G#7")
soundfile = 'sound/piano/G#7.ogg'
if("Ab7")
soundfile = 'sound/piano/Ab7.ogg'
if("An7")
soundfile = 'sound/piano/An7.ogg'
if("A#7")
soundfile = 'sound/piano/A#7.ogg'
if("Bb7")
soundfile = 'sound/piano/Bb7.ogg'
if("Bn7")
soundfile = 'sound/piano/Bn7.ogg'
if("B#7")
soundfile = 'sound/piano/B#7.ogg'
if("Cb8")
soundfile = 'sound/piano/Cb8.ogg'
if("Cn8")
soundfile = 'sound/piano/Cn8.ogg'
if("C#8")
soundfile = 'sound/piano/C#8.ogg'
if("Db8")
soundfile = 'sound/piano/Db8.ogg'
if("Dn8")
soundfile = 'sound/piano/Dn8.ogg'
if("D#8")
soundfile = 'sound/piano/D#8.ogg'
if("Eb8")
soundfile = 'sound/piano/Eb8.ogg'
if("En8")
soundfile = 'sound/piano/En8.ogg'
if("E#8")
soundfile = 'sound/piano/E#8.ogg'
if("Fb8")
soundfile = 'sound/piano/Fb8.ogg'
if("Fn8")
soundfile = 'sound/piano/Fn8.ogg'
if("F#8")
soundfile = 'sound/piano/F#8.ogg'
if("Gb8")
soundfile = 'sound/piano/Gb8.ogg'
if("Gn8")
soundfile = 'sound/piano/Gn8.ogg'
if("G#8")
soundfile = 'sound/piano/G#8.ogg'
if("Ab8")
soundfile = 'sound/piano/Ab8.ogg'
if("An8")
soundfile = 'sound/piano/An8.ogg'
if("A#8")
soundfile = 'sound/piano/A#8.ogg'
if("Bb8")
soundfile = 'sound/piano/Bb8.ogg'
if("Bn8")
soundfile = 'sound/piano/Bn8.ogg'
if("B#8")
soundfile = 'sound/piano/B#8.ogg'
if("Cb9")
soundfile = 'sound/piano/Cb9.ogg'
if("Cn9")
soundfile = 'sound/piano/Cn9.ogg'
else
return
for(var/mob/M in hearers(15, src))
M << sound(soundfile)
playsong()
do
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 song.lines)
//world << line
for(var/beat in dd_text2list(lowertext(line), ","))
//world << "beat: [beat]"
var/list/notes = dd_text2list(beat, "/")
for(var/note in dd_text2list(notes[1], "-"))
//world << "note: [note]"
if(!playing || !anchored)//If the piano is playing, or is loose
playing = 0
return
if(lentext(note) == 0)
continue
//world << "Parse: [copytext(note,1,2)]"
var/cur_note = text2ascii(note) - 96
if(cur_note < 1 || cur_note > 7)
continue
for(var/i=2 to lentext(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] = ni
playnote(uppertext(copytext(note,1,2)) + cur_acc[cur_note] + cur_oct[cur_note])
if(notes.len >= 2 && text2num(notes[2]))
sleep(song.tempo / text2num(notes[2]))
else
sleep(song.tempo)
if(repeat > 0)
repeat-- //Infinite loops are baaaad.
while(repeat > 0)
playing = 0
updateUsrDialog()
attack_hand(var/mob/user as mob)
if(!anchored)
return
usr.machine = src
var/dat = "<HEAD><TITLE>Piano</TITLE></HEAD><BODY>"
if(song)
if(song.lines.len > 0 && !(playing))
dat += "<A href='?src=\ref[src];play=1'>Play Song</A><BR><BR>"
dat += "<A href='?src=\ref[src];repeat=1'>Repeat Song: [repeat] times.</A><BR><BR>"
if(playing)
dat += "<A href='?src=\ref[src];stop=1'>Stop Playing</A><BR>"
dat += "Repeats left: [repeat].<BR><BR>"
if(!edit)
dat += "<A href='?src=\ref[src];edit=2'>Show Editor</A><BR><BR>"
else
dat += "<A href='?src=\ref[src];edit=1'>Hide Editor</A><BR>"
dat += "<A href='?src=\ref[src];newsong=1'>Start a New Song</A><BR>"
dat += "<A href='?src=\ref[src];import=1'>Import a Song</A><BR><BR>"
if(song)
var/calctempo = (10/song.tempo)*60
dat += "Tempo : <A href='?src=\ref[src];tempo=10'>-</A><A href='?src=\ref[src];tempo=1'>-</A> [calctempo] BPM <A href='?src=\ref[src];tempo=-1'>+</A><A href='?src=\ref[src];tempo=-10'>+</A><BR><BR>"
var/linecount = 0
for(var/line in song.lines)
linecount += 1
dat += "Line [linecount]: [line] <A href='?src=\ref[src];deleteline=[linecount]'>Delete Line</A> <A href='?src=\ref[src];modifyline=[linecount]'>Modify Line</A><BR>"
dat += "<A href='?src=\ref[src];newline=1'>Add Line</A><BR><BR>"
if(help)
dat += "<A href='?src=\ref[src];help=1'>Hide Help</A><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,/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 += "<A href='?src=\ref[src];help=2'>Show Help</A><BR>"
dat += "</BODY></HTML>"
user << browse(dat, "window=piano;size=700x300")
onclose(user, "piano")
Topic(href, href_list)
if(!in_range(src, usr) || issilicon(usr) || !anchored || !usr.canmove || usr.restrained())
usr << browse(null, "window=piano;size=700x300")
onclose(usr, "piano")
return
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.
var/tempnum = input("How many times do you want to repeat this piece? (max:10)") as num
if(tempnum > 10)
tempnum = 10
repeat = tempnum
else if(href_list["tempo"])
song.tempo += text2num(href_list["tempo"])
if(song.tempo < 1)
song.tempo = 1
else if(href_list["play"])
if(song)
playing = 1
spawn() playsong()
else if(href_list["newsong"])
song = new()
else if(href_list["newline"])
var/newline = input("Enter your line: ", "Piano") as text|null
if(!newline)
return
if(song.lines.len > 50)
return
if(lentext(newline) > 50)
newline = copytext(newline, 1, 50)
song.lines.Add(newline)
else if(href_list["deleteline"])
var/num = text2num(href_list["deleteline"])
song.lines.Cut(num, num+1)
else if(href_list["modifyline"])
var/num = text2num(href_list["modifyline"])
var/content = input("Enter your line: ", "Piano", song.lines[num]) as text|null
if(!content)
return
if(lentext(content) > 50)
content = copytext(content, 1, 50)
song.lines[num] = content
else if(href_list["stop"])
playing = 0
else if(href_list["help"])
help = text2num(href_list["help"]) - 1
else if(href_list["edit"])
edit = text2num(href_list["edit"]) - 1
else if(href_list["import"])
var/t = ""
do
t = input(usr, "Please paste the entire song, formatted:", text("[]", src.name), t) as message
if (!in_range(src, usr))
return
if(lentext(t) >= 3072)
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(lentext(t) > 3072)
//split into lines
spawn()
var/list/lines = dd_text2list(t, "\n")
var/tempo = 5
if(copytext(lines[1],1,6) == "BPM: ")
tempo = 600 / text2num(copytext(lines[1],6))
lines.Cut(1,2)
if(lines.len > 50)
usr << "Too many lines!"
lines.Cut(51)
var/linenum = 1
for(var/l in lines)
if(lentext(l) > 50)
usr << "Line [linenum] too long!"
lines.Remove(l)
else
linenum++
song = new()
song.lines = lines
song.tempo = tempo
updateUsrDialog()
add_fingerprint(usr)
updateUsrDialog()
return
attackby(obj/item/O as obj, mob/user as mob)
if (istype(O, /obj/item/weapon/wrench))
if (anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to loosen \the [src]'s casters..."
if (do_after(user, 40))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
"\blue You have loosened \the [src]. Now it can be pulled somewhere else.", \
"You hear ratchet.")
src.anchored = 0
else
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to tighten \the [src] to the floor..."
if (do_after(user, 20))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
"\blue You have tightened \the [src]'s casters. Now it can be played again.", \
"You hear ratchet.")
src.anchored = 1
else
..()