TG: - Removed support for the ONBACK and ONBELT flags.

- Replaced them with a whole range of inventory slot flags. These now govern
whether an item can or can't be placed in a certain inventory slot. See setup.dm
for information on the flags. These flags only affect humans tho, as humans are
the only beings with an inventory to talk of.
- Standardized some gun code and some other pieces of code as I came accross
them. I hate indented variable definitions!

This commit should not bring any change whatsoever to the game from a player's
perspective.
Revision: r3659
Author: 	 baloh.matevz
This commit is contained in:
Erthilo
2012-05-28 22:58:57 +01:00
parent 9b5d6f6ec3
commit a7dd312b3e
69 changed files with 863 additions and 914 deletions

View File

@@ -11,9 +11,6 @@
item_state = "flashbang"
w_class = 2.0
force = 2.0
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT | USEDELAY
var/obj/item/weapon/reagent_containers/glass/beaker_one
var/obj/item/weapon/reagent_containers/glass/beaker_two
var/obj/item/device/assembly/attached_device
@@ -27,6 +24,10 @@
var/list/allowed_containers = list("/obj/item/weapon/reagent_containers/glass/beaker", "/obj/item/weapon/reagent_containers/glass/dispenser", "/obj/item/weapon/reagent_containers/glass/bottle")
var/affected_area = 3
var/mob/attacher = "Unknown"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BELT
attackby(var/obj/item/weapon/W, var/mob/user)
if(path || !active)
@@ -784,7 +785,7 @@
/obj/structure/table,
/obj/structure/closet/secure_closet,
/obj/structure/closet,
/obj/machinery/sink,
/obj/structure/sink,
/obj/item/weapon/storage,
/obj/machinery/atmospherics/unary/cryo_cell,
/obj/item/weapon/chem_grenade,
@@ -1304,7 +1305,8 @@
amount_per_transfer_from_this = 5
volume = 30
possible_transfer_amounts = null
flags = FPRINT | ONBELT | TABLEPASS | OPENCONTAINER
flags = FPRINT | TABLEPASS | OPENCONTAINER
slot_flags = SLOT_BELT
/obj/item/weapon/reagent_containers/hypospray/attack_paw(mob/user as mob)
return src.attack_hand(user)

View File

@@ -4,6 +4,7 @@
name = "ears"
w_class = 1.0
throwforce = 2
slot_flags = SLOT_EARS
var/twoeared = 0
/obj/item/clothing/ears/attack_hand(mob/user as mob)

View File

@@ -296,7 +296,8 @@
icon = 'weapons.dmi'
icon_state = "baton"
item_state = "classic_baton"
flags = FPRINT | ONBELT | TABLEPASS
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
force = 10
/obj/item/clothing/under/pirate

View File

@@ -3,11 +3,11 @@
icon = 'glasses.dmi'
w_class = 2.0
flags = GLASSESCOVERSEYES
var
vision_flags = 0
darkness_view = 0//Base human is 2
invisa_view = 0
prescription = 0
slot_flags = SLOT_EYES
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/invisa_view = 0
var/prescription = 0
/*
SEE_SELF // can see self, no matter what

View File

@@ -12,6 +12,7 @@
var/wired = 0
var/obj/item/weapon/cell/cell = 0
body_parts_covered = HANDS
slot_flags = SLOT_GLOVES
/obj/item/clothing/gloves/boxing

View File

@@ -3,6 +3,7 @@
name = "head"
icon = 'hats.dmi'
body_parts_covered = HEAD
slot_flags = SLOT_HEAD
var/list/allowed = list()
/obj/item/clothing/head/cakehat
@@ -83,8 +84,24 @@
icon_state = "beret"
flags = FPRINT | TABLEPASS
/obj/item/clothing/head/chaplain_hood
name = "chaplain's hood"
desc = "It's hood that covers the head. It keeps you warm during the space winters."
icon_state = "chaplain_hood"
flags = FPRINT|TABLEPASS|HEADSPACE|HEADCOVERSEYES|BLOCKHAIR
/obj/item/clothing/head/hasturhood
name = "hastur's hood"
desc = "It's unspeakably stylish"
icon_state = "hasturhood"
flags = FPRINT|TABLEPASS|HEADSPACE|HEADCOVERSEYES|BLOCKHAIR
/obj/item/clothing/head/nursehat
name = "nurse's hat"
desc = "It allows quick identification of trained medical personnel."
icon_state = "nursehat"
flags = FPRINT|TABLEPASS
// CHUMP HELMETS: COOKING THEM DESTROYS THE CHUMP HELMET SPAWN.
/obj/item/clothing/head/helmet/cueball
name = "cueball helmet"
@@ -109,6 +126,8 @@
item_state = "helmet"
var/flipped = 0
// CHUMP HELMETS: COOKING THEM DESTROYS THE CHUMP HELMET SPAWN.
/obj/item/clothing/head/syndicatefake
name = "red space-helmet replica"
desc = "A plastic replica of a red space space helmet. This is a toy, it is not made for use in space!"
@@ -118,24 +137,6 @@
flags = FPRINT | TABLEPASS | BLOCKHAIR
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
/obj/item/clothing/head/chaplain_hood
name = "chaplain's hood"
desc = "It's hood that covers the head. It keeps you warm during the space winters."
icon_state = "chaplain_hood"
flags = FPRINT|TABLEPASS|HEADSPACE|HEADCOVERSEYES|BLOCKHAIR
/obj/item/clothing/head/hasturhood
name = "hastur's hood"
desc = "It's unspeakably stylish"
icon_state = "hasturhood"
flags = FPRINT|TABLEPASS|HEADSPACE|HEADCOVERSEYES|BLOCKHAIR
/obj/item/clothing/head/nursehat
name = "nurse's hat"
desc = "It allows quick identification of trained medical personnel."
icon_state = "nursehat"
flags = FPRINT|TABLEPASS
/obj/item/clothing/head/helmet/cardborg
name = "cardborg helmet"
desc = "A helmet made out of a box."

View File

@@ -8,6 +8,7 @@
heat_transfer_coefficient = 0.30
permeability_coefficient = 0.90
flags = FPRINT | TABLEPASS
slot_flags = SLOT_ICLOTHING
var/has_sensor = 1//For the crew computer 2 = unable to change mode
var/sensor_mode = 0
/*

View File

@@ -73,6 +73,7 @@
desc = "A face-covering mask that can be connected to an air supply."
icon_state = "gas_alt"
flags = FPRINT|TABLEPASS|SUITSPACE|MASKCOVERSMOUTH|MASKCOVERSEYES
flags_inv = HIDEEARS|HIDEEYES
w_class = 3.0
see_face = 0.0
item_state = "gas_alt"

View File

@@ -5,6 +5,7 @@
gender = PLURAL //Carn: for grammarically correct text-parsing
body_parts_covered = FEET
slot_flags = SLOT_FEET
protective_temperature = 500
heat_transfer_coefficient = 0.10

View File

@@ -5,3 +5,4 @@
flags = FPRINT | TABLEPASS
var/list/allowed = list(/obj/item/weapon/tank/emergency_oxygen)
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
slot_flags = SLOT_OCLOTHING

View File

@@ -1096,7 +1096,7 @@
reagents.add_reagent("nutriment",12)
afterattack(obj/O as obj, mob/user as mob)
if(istype(O,/obj/machinery/sink) && !wrapped)
if(istype(O,/obj/structure/sink) && !wrapped)
user << "You place [name] under a stream of water..."
loc = get_turf(O)
return Expand()

View File

@@ -154,7 +154,8 @@ proc/move_mining_shuttle()
name = "Miner's pickaxe"
icon = 'items.dmi'
icon_state = "pickaxe"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
force = 15.0
throwforce = 4.0
item_state = "pickaxe"
@@ -238,7 +239,8 @@ proc/move_mining_shuttle()
name = "Shovel"
icon = 'items.dmi'
icon_state = "shovel"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
force = 8.0
throwforce = 4.0
item_state = "shovel"

View File

@@ -6,7 +6,8 @@
name = "Mining Satchel"
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/capacity = 50; //the number of ore pieces it can carry.
flags = FPRINT | TABLEPASS | ONBELT
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
w_class = 1
/obj/item/weapon/satchel/attack_self(mob/user as mob)

View File

@@ -554,7 +554,7 @@
return
if (!istype(W, /obj/item))
return
if (!( W.flags & ONBACK ))
if (!( W.slot_flags & SLOT_BACK ))
return
if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>"
@@ -578,7 +578,10 @@
if (emptyHand)
wear_suit.DblClick()
return
if (!( istype(W, /obj/item/clothing/suit) ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_OCLOTHING ))
return
return
u_equip(W)
wear_suit = W
@@ -588,7 +591,9 @@
if (emptyHand)
gloves.DblClick()
return
if (!( istype(W, /obj/item/clothing/gloves) ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_GLOVES ))
return
u_equip(W)
gloves = W
@@ -598,7 +603,9 @@
if (emptyHand)
shoes.DblClick()
return
if (!( istype(W, /obj/item/clothing/shoes) ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_FEET ))
return
u_equip(W)
shoes = W
@@ -608,7 +615,9 @@
if (emptyHand)
belt.DblClick()
return
if (!W || !W.flags || !( W.flags & ONBELT ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_BELT ))
return
u_equip(W)
belt = W
@@ -618,7 +627,9 @@
if (emptyHand)
glasses.DblClick()
return
if (!( istype(W, /obj/item/clothing/glasses) ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_EYES ))
return
u_equip(W)
glasses = W
@@ -628,10 +639,9 @@
if (emptyHand)
head.DblClick()
return
if (( istype(W, /obj/item/weapon/paper) ))
u_equip(W)
head = W
else if (!( istype(W, /obj/item/clothing/head) ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_HEAD ))
return
u_equip(W)
head = W
@@ -683,7 +693,10 @@
if (emptyHand)
w_uniform.DblClick()
return
if (!( istype(W, /obj/item/clothing/under) ))
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_ICLOTHING ))
return
return
u_equip(W)
w_uniform = W
@@ -695,7 +708,9 @@
return
if (!w_uniform)
return
if (!istype(W, /obj/item/weapon/card/id) && !istype(W, /obj/item/device/pda) )
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_ID ))
return
u_equip(W)
wear_id = W
@@ -705,19 +720,25 @@
if (emptyHand)
l_store.DblClick()
return
if ((!( istype(W, /obj/item) ) || W.w_class > 2 || !( w_uniform )))
if (!istype(W, /obj/item))
return
u_equip(W)
l_store = W
if ( ( W.slot_flags & SLOT_DENYPOCKET ) )
return
if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) )
u_equip(W)
l_store = W
if("storage2")
if (r_store)
if (emptyHand)
r_store.DblClick()
return
if ((!( istype(W, /obj/item) ) || W.w_class > 2 || !( w_uniform )))
if (!istype(W, /obj/item))
return
u_equip(W)
r_store = W
if ( ( W.slot_flags & SLOT_DENYPOCKET ) )
return
if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) )
u_equip(W)
r_store = W
if("suit storage")
if (s_store)
if (emptyHand)

View File

@@ -1,10 +1,9 @@
/mob/new_player
var
datum/preferences/preferences = null
ready = 0
spawning = 0//Referenced when you want to delete the new_player later on in the code.
totalPlayers = 0 //Player counts for the Lobby tab
totalPlayersReady = 0
var/datum/preferences/preferences = null
var/ready = 0
var/spawning = 0//Referenced when you want to delete the new_player later on in the code.
var/totalPlayers = 0 //Player counts for the Lobby tab
var/totalPlayersReady = 0
invisibility = 101

View File

@@ -9,7 +9,8 @@
throw_range = 10
var/obj/item/weapon/pen/haspen //The stored pen.
var/obj/item/weapon/paper/toppaper //The topmost piece of paper.
flags = FPRINT | TABLEPASS | ONBELT
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
pressure_resistance = 10
/obj/item/weapon/clipboard/New()

View File

@@ -9,280 +9,277 @@
throw_range = 15
layer = 4
pressure_resistance = 1
slot_flags = SLOT_HEAD
see_face = 1
body_parts_covered = HEAD
protective_temperature = 0
var
info //What's actually written on the paper.
info_links //A different version of the paper which includes html links at fields and EOF
stamps //The (text for the) stamps on the paper.
fields //Amount of user created fields
list/stamped
see_face = 1
body_parts_covered = HEAD
protective_temperature = 0
rigged = 0
spam_flag = 0
var/info //What's actually written on the paper.
var/info_links //A different version of the paper which includes html links at fields and EOF
var/stamps //The (text for the) stamps on the paper.
var/fields //Amount of user created fields
var/list/stamped
var/rigged = 0
var/spam_flag = 0
const
deffont = "Verdana"
signfont = "Times New Roman"
crayonfont = "Comic Sans MS"
var/const/deffont = "Verdana"
var/const/signfont = "Times New Roman"
var/const/crayonfont = "Comic Sans MS"
New()
..()
src.pixel_y = rand(-8, 8)
src.pixel_x = rand(-9, 9)
spawn(2)
if(src.info)
src.overlays += "paper_words"
updateinfolinks()
return
update_icon()
/obj/item/weapon/paper/New()
..()
src.pixel_y = rand(-8, 8)
src.pixel_x = rand(-9, 9)
spawn(2)
if(src.info)
src.overlays += "paper_words"
return
examine()
set src in oview(1)
// ..() //We don't want them to see the dumb "this is a paper" thing every time.
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
verb/rename()
set name = "Rename paper"
set category = "Object"
set src in usr
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
return
var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text),1,MAX_NAME_LEN)
n_name = copytext(n_name, 1, 32)
if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
return
attack_self(mob/living/user as mob)
examine()
if(rigged && (Holiday == "April Fool's Day"))
if(spam_flag == 0)
spam_flag = 1
playsound(src.loc, 'bikehorn.ogg', 50, 1)
spawn(20)
spam_flag = 0
return
attack_ai(var/mob/living/silicon/ai/user as mob)
var/dist
if (istype(user) && user.current) //is AI
dist = get_dist(src, user.current)
else //cyborg or AI not seeing through a camera
dist = get_dist(src, user)
if (dist < 2)
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
proc
addtofield(var/id, var/text, var/links = 0)
var/locid = 0
var/laststart = 1
var/textindex = 1
while(1) // I know this can cause infinite loops and fuck up the whole server, but the if(istart==0) should be safe as fuck
var/istart = 0
if(links)
istart = findtext(info_links, "<span class=\"paper_field\">", laststart)
else
istart = findtext(info, "<span class=\"paper_field\">", laststart)
if(istart==0)
return // No field found with matching id
laststart = istart+1
locid++
if(locid == id)
var/iend = 1
if(links)
iend = findtext(info_links, "</span>", istart)
else
iend = findtext(info, "</span>", istart)
//textindex = istart+26
textindex = iend
break
if(links)
var/before = copytext(info_links, 1, textindex)
var/after = copytext(info_links, textindex)
info_links = before + text + after
else
var/before = copytext(info, 1, textindex)
var/after = copytext(info, textindex)
info = before + text + after
updateinfolinks()
updateinfolinks()
info_links = info
var/i = 0
for(i=1,i<=fields,i++)
addtofield(i, "<font face=\"[deffont]\"><A href='?src=\ref[src];write=[i]'>write</A></font>", 1)
info_links = info_links + "<font face=\"[deffont]\"><A href='?src=\ref[src];write=end'>write</A></font>"
return
parsepencode(var/t, var/obj/item/weapon/pen/P, mob/user as mob, var/iscrayon = 0)
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
/obj/item/weapon/paper/update_icon()
if(src.info)
src.overlays += "paper_words"
return
t = dd_replacetext(t, "\[center\]", "<center>")
t = dd_replacetext(t, "\[/center\]", "</center>")
t = dd_replacetext(t, "\[br\]", "<BR>")
t = dd_replacetext(t, "\[b\]", "<B>")
t = dd_replacetext(t, "\[/b\]", "</B>")
t = dd_replacetext(t, "\[i\]", "<I>")
t = dd_replacetext(t, "\[/i\]", "</I>")
t = dd_replacetext(t, "\[u\]", "<U>")
t = dd_replacetext(t, "\[/u\]", "</U>")
t = dd_replacetext(t, "\[large\]", "<font size = \"4\">")
t = dd_replacetext(t, "\[/large\]", "</font>")
t = dd_replacetext(t, "\[sign\]", "<font face=\"[signfont]\"><i>[user.real_name]</i></font>")
t = dd_replacetext(t, "\[field\]", "<span class=\"paper_field\"></span>")
/obj/item/weapon/paper/examine()
set src in oview(1)
if(!iscrayon)
t = dd_replacetext(t, "\[*\]", "<li>")
t = dd_replacetext(t, "\[hr\]", "<HR>")
t = dd_replacetext(t, "\[small\]", "<font size = \"1\">")
t = dd_replacetext(t, "\[/small\]", "</font>")
t = dd_replacetext(t, "\[list\]", "<ul>")
t = dd_replacetext(t, "\[/list\]", "</ul>")
// ..() //We don't want them to see the dumb "this is a paper" thing every time.
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
t = "<font face=\"[deffont]\" color=[P.colour]>[t]</font>"
else // If it is a crayon, and he still tries to use these, make them empty!
t = dd_replacetext(t, "\[*\]", "")
t = dd_replacetext(t, "\[hr\]", "")
t = dd_replacetext(t, "\[small\]", "")
t = dd_replacetext(t, "\[/small\]", "")
t = dd_replacetext(t, "\[list\]", "")
t = dd_replacetext(t, "\[/list\]", "")
/obj/item/weapon/paper/verb/rename()
set name = "Rename paper"
set category = "Object"
set src in usr
t = "<font face=\"[crayonfont]\" color=[P.colour]><b>[t]</b></font>"
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
return
var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text),1,MAX_NAME_LEN)
if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
return
//Count the fields
var/laststart = 1
while(1)
var/i = findtext(t, "<span class=\"paper_field\">", laststart)
if(i==0)
break
laststart = i+1
fields++
/obj/item/weapon/paper/attack_self(mob/living/user as mob)
examine()
if(rigged && (Holiday == "April Fool's Day"))
if(spam_flag == 0)
spam_flag = 1
playsound(src.loc, 'bikehorn.ogg', 50, 1)
spawn(20)
spam_flag = 0
return
return t
/obj/item/weapon/paper/attack_ai(var/mob/living/silicon/ai/user as mob)
var/dist
if (istype(user) && user.current) //is AI
dist = get_dist(src, user.current)
else //cyborg or AI not seeing through a camera
dist = get_dist(src, user)
if (dist < 2)
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
return
openhelp(mob/user as mob)
user << browse({"<HTML><HEAD><TITLE>Pen Help</TITLE></HEAD>
<BODY>
<b><center>Crayon&Pen commands</center></b><br>
<br>
\[br\] : Creates a linebreak.<br>
\[center\] - \[/center\] : Centers the text.<br>
\[b\] - \[/b\] : Makes the text <b>bold</b>.<br>
\[i\] - \[/i\] : Makes the text <i>italic</i>.<br>
\[u\] - \[/u\] : Makes the text <u>underlined</u>.<br>
\[large\] - \[/large\] : Increases the <font size = \"4\">size</font> of the text.<br>
\[sign\] : Inserts a signature of your name in a foolproof way.<br>
\[field\] : Inserts an invisible field which lets you start type from there. Useful for forms.<br>
<br>
<b><center>Pen exclusive commands</center></b><br>
\[small\] - \[/small\] : Decreases the <font size = \"1\">size</font> of the text.<br>
\[list\] - \[/list\] : A list.<br>
\[*\] : A dot used for lists.<br>
\[hr\] : Adds a horizontal rule.
</BODY></HTML>"}, "window=paper_help")
/obj/item/weapon/paper/proc/addtofield(var/id, var/text, var/links = 0)
var/locid = 0
var/laststart = 1
var/textindex = 1
while(1) // I know this can cause infinite loops and fuck up the whole server, but the if(istart==0) should be safe as fuck
var/istart = 0
if(links)
istart = findtext(info_links, "<span class=\"paper_field\">", laststart)
else
istart = findtext(info, "<span class=\"paper_field\">", laststart)
if(istart==0)
return // No field found with matching id
Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()))
return
if(href_list["write"])
var/id = href_list["write"]
var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as text
var/obj/item/i = usr.equipped() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
if(!istype(i, /obj/item/weapon/pen))
if(!istype(i, /obj/item/toy/crayon))
return
iscrayon = 1
if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.equipped() != i)) // Some check to see if he's allowed to write
return
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
if(id!="end")
addtofield(text2num(id), t) // He wants to edit a field, let him.
laststart = istart+1
locid++
if(locid == id)
var/iend = 1
if(links)
iend = findtext(info_links, "</span>", istart)
else
info += t // Oh, he wants to edit to the end of the file, let him.
updateinfolinks()
iend = findtext(info, "</span>", istart)
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]") // Update the window
//textindex = istart+26
textindex = iend
break
if(!overlays.Find("paper_words"))
overlays += "paper_words"
if(links)
var/before = copytext(info_links, 1, textindex)
var/after = copytext(info_links, textindex)
info_links = before + text + after
else
var/before = copytext(info, 1, textindex)
var/after = copytext(info, textindex)
info = before + text + after
updateinfolinks()
attackby(obj/item/weapon/P as obj, mob/user as mob)
..()
var/clown = 0
if(user.mind && (user.mind.assigned_role == "Clown"))
clown = 1
/obj/item/weapon/paper/proc/updateinfolinks()
info_links = info
var/i = 0
for(i=1,i<=fields,i++)
addtofield(i, "<font face=\"[deffont]\"><A href='?src=\ref[src];write=[i]'>write</A></font>", 1)
info_links = info_links + "<font face=\"[deffont]\"><A href='?src=\ref[src];write=end'>write</A></font>"
if (istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]")
//openhelp(user)
return
else if(istype(P, /obj/item/weapon/stamp))
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P))
/obj/item/weapon/paper/proc/parsepencode(var/t, var/obj/item/weapon/pen/P, mob/user as mob, var/iscrayon = 0)
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
t = dd_replacetext(t, "\[center\]", "<center>")
t = dd_replacetext(t, "\[/center\]", "</center>")
t = dd_replacetext(t, "\[br\]", "<BR>")
t = dd_replacetext(t, "\[b\]", "<B>")
t = dd_replacetext(t, "\[/b\]", "</B>")
t = dd_replacetext(t, "\[i\]", "<I>")
t = dd_replacetext(t, "\[/i\]", "</I>")
t = dd_replacetext(t, "\[u\]", "<U>")
t = dd_replacetext(t, "\[/u\]", "</U>")
t = dd_replacetext(t, "\[large\]", "<font size = \"4\">")
t = dd_replacetext(t, "\[/large\]", "</font>")
t = dd_replacetext(t, "\[sign\]", "<font face=\"[signfont]\"><i>[user.real_name]</i></font>")
t = dd_replacetext(t, "\[field\]", "<span class=\"paper_field\"></span>")
if(!iscrayon)
t = dd_replacetext(t, "\[*\]", "<li>")
t = dd_replacetext(t, "\[hr\]", "<HR>")
t = dd_replacetext(t, "\[small\]", "<font size = \"1\">")
t = dd_replacetext(t, "\[/small\]", "</font>")
t = dd_replacetext(t, "\[list\]", "<ul>")
t = dd_replacetext(t, "\[/list\]", "</ul>")
t = "<font face=\"[deffont]\" color=[P.colour]>[t]</font>"
else // If it is a crayon, and he still tries to use these, make them empty!
t = dd_replacetext(t, "\[*\]", "")
t = dd_replacetext(t, "\[hr\]", "")
t = dd_replacetext(t, "\[small\]", "")
t = dd_replacetext(t, "\[/small\]", "")
t = dd_replacetext(t, "\[list\]", "")
t = dd_replacetext(t, "\[/list\]", "")
t = "<font face=\"[crayonfont]\" color=[P.colour]><b>[t]</b></font>"
//Count the fields
var/laststart = 1
while(1)
var/i = findtext(t, "<span class=\"paper_field\">", laststart)
if(i==0)
break
laststart = i+1
fields++
return t
/obj/item/weapon/paper/proc/openhelp(mob/user as mob)
user << browse({"<HTML><HEAD><TITLE>Pen Help</TITLE></HEAD>
<BODY>
<b><center>Crayon&Pen commands</center></b><br>
<br>
\[br\] : Creates a linebreak.<br>
\[center\] - \[/center\] : Centers the text.<br>
\[b\] - \[/b\] : Makes the text <b>bold</b>.<br>
\[i\] - \[/i\] : Makes the text <i>italic</i>.<br>
\[u\] - \[/u\] : Makes the text <u>underlined</u>.<br>
\[large\] - \[/large\] : Increases the <font size = \"4\">size</font> of the text.<br>
\[sign\] : Inserts a signature of your name in a foolproof way.<br>
\[field\] : Inserts an invisible field which lets you start type from there. Useful for forms.<br>
<br>
<b><center>Pen exclusive commands</center></b><br>
\[small\] - \[/small\] : Decreases the <font size = \"1\">size</font> of the text.<br>
\[list\] - \[/list\] : A list.<br>
\[*\] : A dot used for lists.<br>
\[hr\] : Adds a horizontal rule.
</BODY></HTML>"}, "window=paper_help")
/obj/item/weapon/paper/Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()))
return
if(href_list["write"])
var/id = href_list["write"]
var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as text
var/obj/item/i = usr.equipped() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
if(!istype(i, /obj/item/weapon/pen))
if(!istype(i, /obj/item/toy/crayon))
return
iscrayon = 1
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
switch(P.type)
if(/obj/item/weapon/stamp/captain)
overlays += "paper_stamped_cap"
if(/obj/item/weapon/stamp/hop)
overlays += "paper_stamped_hop"
if(/obj/item/weapon/stamp/hos)
overlays += "paper_stamped_hos"
if(/obj/item/weapon/stamp/ce)
overlays += "paper_stamped_ce"
if(/obj/item/weapon/stamp/rd)
overlays += "paper_stamped_rd"
if(/obj/item/weapon/stamp/cmo)
overlays += "paper_stamped_cmo"
if(/obj/item/weapon/stamp/denied)
overlays += "paper_stamped_denied"
if(/obj/item/weapon/stamp/clown)
if (!clown)
usr << "\red You are totally unable to use the stamp. HONK!"
return
else
overlays += "paper_stamped_clown"
if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.equipped() != i)) // Some check to see if he's allowed to write
return
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
if(id!="end")
addtofield(text2num(id), t) // He wants to edit a field, let him.
else
info += t // Oh, he wants to edit to the end of the file, let him.
updateinfolinks()
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]") // Update the window
if(!overlays.Find("paper_words"))
overlays += "paper_words"
/obj/item/weapon/paper/attackby(obj/item/weapon/P as obj, mob/user as mob)
..()
var/clown = 0
if(user.mind && (user.mind.assigned_role == "Clown"))
clown = 1
if (istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon))
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]")
//openhelp(user)
return
else if(istype(P, /obj/item/weapon/stamp))
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P))
return
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
switch(P.type)
if(/obj/item/weapon/stamp/captain)
overlays += "paper_stamped_cap"
if(/obj/item/weapon/stamp/hop)
overlays += "paper_stamped_hop"
if(/obj/item/weapon/stamp/hos)
overlays += "paper_stamped_hos"
if(/obj/item/weapon/stamp/ce)
overlays += "paper_stamped_ce"
if(/obj/item/weapon/stamp/rd)
overlays += "paper_stamped_rd"
if(/obj/item/weapon/stamp/cmo)
overlays += "paper_stamped_cmo"
if(/obj/item/weapon/stamp/denied)
overlays += "paper_stamped_denied"
if(/obj/item/weapon/stamp/clown)
if (!clown)
usr << "\red You are totally unable to use the stamp. HONK!"
return
else
overlays += "paper_stamped"
if(!stamped)
stamped = new
stamped += P.type
overlays += "paper_stamped_clown"
else
overlays += "paper_stamped"
if(!stamped)
stamped = new
stamped += P.type
user << "\blue You stamp the paper with your rubber stamp."
add_fingerprint(user)
return
user << "\blue You stamp the paper with your rubber stamp."
add_fingerprint(user)
return

View File

@@ -3,7 +3,8 @@
name = "pen"
icon = 'bureaucracy.dmi'
icon_state = "pen"
flags = FPRINT | ONBELT | TABLEPASS
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT | SLOT_EARS
throwforce = 0
w_class = 1.0
throw_speed = 7

View File

@@ -3,13 +3,13 @@
desc = "A bullet casing."
icon = 'ammo.dmi'
icon_state = "s-casing"
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
throwforce = 1
w_class = 1.0
var
caliber = "" //Which kind of guns it can be loaded into
projectile_type = ""//The bullet type to create when New() is called
obj/item/projectile/BB = null //The loaded bullet
var/caliber = "" //Which kind of guns it can be loaded into
var/projectile_type = ""//The bullet type to create when New() is called
var/obj/item/projectile/BB = null //The loaded bullet
New()
@@ -28,18 +28,18 @@
desc = "A box of ammo"
icon_state = "357"
icon = 'ammo.dmi'
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
item_state = "syringe_kit"
m_amt = 50000
throwforce = 2
w_class = 1.0
throw_speed = 4
throw_range = 10
var
list/stored_ammo = list()
ammo_type = "/obj/item/ammo_casing"
max_ammo = 7
multiple_sprites = 0
var/list/stored_ammo = list()
var/ammo_type = "/obj/item/ammo_casing"
var/max_ammo = 7
var/multiple_sprites = 0
New()

View File

@@ -4,7 +4,8 @@
icon = 'gun.dmi'
icon_state = "detective"
item_state = "gun"
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT | USEDELAY
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BELT
m_amt = 2000
w_class = 3.0
throwforce = 5
@@ -13,19 +14,18 @@
force = 5.0
origin_tech = "combat=1"
var
fire_sound = 'Gunshot.ogg'
tmp/obj/item/projectile/in_chamber = null
caliber = ""
silenced = 0
recoil = 0
ejectshell = 1
tmp/list/mob/living/target //List of who yer targeting.
tmp/lock_time = -100
tmp/mouthshoot = 0 ///To stop people from suiciding twice... >.>
automatic = 0 //Used to determine if you can target multiple people.
tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/fire_sound = 'Gunshot.ogg'
var/tmp/obj/item/projectile/in_chamber = null
var/caliber = ""
var/silenced = 0
var/recoil = 0
var/ejectshell = 1
var/tmp/list/mob/living/target //List of who yer targeting.
var/tmp/lock_time = -100
var/tmp/mouthshoot = 0 ///To stop people from suiciding twice... >.>
var/automatic = 0 //Used to determine if you can target multiple people.
var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
proc/load_into_chamber()
return 0
@@ -165,14 +165,16 @@
if (!istype(targloc) || !istype(curloc))
return
if(!special_check(user)) return
if(!special_check(user))
return
if(!load_into_chamber())
user.visible_message("*click click*", "\red <b>*click*</b>")
for(var/mob/K in viewers(usr))
K << 'empty.ogg'
return
if(!in_chamber) return
if(!in_chamber)
return
in_chamber.firer = user
in_chamber.def_zone = user.zone_sel.selecting
@@ -191,7 +193,7 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
user.visible_message("\red [user] fires the [src]!", "\red You fire the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
user.visible_message("\red [user] fires \the [src]!", "\red You fire \the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
in_chamber.original = targloc
in_chamber.loc = get_turf(user)
@@ -210,7 +212,8 @@
in_chamber.p_y = text2num(mouse_control["icon-y"])
spawn()
if(in_chamber) in_chamber.fired()
if(in_chamber)
in_chamber.fired()
sleep(1)
in_chamber = null

View File

@@ -4,12 +4,11 @@
desc = "A basic energy-based gun."
fire_sound = 'Taser.ogg'
var
obj/item/weapon/cell/power_supply //What type of power cell this uses
charge_cost = 100 //How much energy is needed to fire.
cell_type = "/obj/item/weapon/cell"
projectile_type = "/obj/item/projectile/energy"
modifystate
var/obj/item/weapon/cell/power_supply //What type of power cell this uses
var/charge_cost = 100 //How much energy is needed to fire.
var/cell_type = "/obj/item/weapon/cell"
var/projectile_type = "/obj/item/projectile/energy"
var/modifystate
emp_act(severity)
power_supply.use(round(power_supply.maxcharge / severity))

View File

@@ -10,8 +10,7 @@
origin_tech = "combat=3;magnets=2"
modifystate = "energystun"
var
mode = 0 //0 = stun, 1 = kill
var/mode = 0 //0 = stun, 1 = kill
attack_self(mob/living/user as mob)

View File

@@ -5,7 +5,8 @@
fire_sound = 'Laser.ogg'
origin_tech = "combat=2;magnets=4"
w_class = 4.0
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BACK
charge_cost = 100
projectile_type = "/obj/item/projectile/ion"
@@ -27,7 +28,8 @@ obj/item/weapon/gun/energy/staff
icon_state = "staffofchange"
item_state = "staffofchange"
fire_sound = 'emitter.ogg'
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BACK
w_class = 4.0
charge_cost = 200
projectile_type = "/obj/item/projectile/change"

View File

@@ -8,12 +8,11 @@
m_amt = 1000
force = 10 //Pistol whipp'n good. (It was frigging SIXTY on pre-goon code)
var
ammo_type = "/obj/item/ammo_casing/a357"
list/loaded = list()
max_shells = 7
load_method = 0 //0 = Single shells or quick loader, 1 = box, 2 = magazine
obj/item/ammo_magazine/empty_mag = null
var/ammo_type = "/obj/item/ammo_casing/a357"
var/list/loaded = list()
var/max_shells = 7
var/load_method = 0 //0 = Single shells or quick loader, 1 = box, 2 = magazine
var/obj/item/ammo_magazine/empty_mag = null
New()

View File

@@ -6,14 +6,14 @@
max_shells = 4
w_class = 4.0
force = 10
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BACK
caliber = "shotgun"
origin_tech = "combat=4;materials=2"
ammo_type = "/obj/item/ammo_casing/shotgun/beanbag"
var
recentpump = 0 // to prevent spammage
pumped = 0
obj/item/ammo_casing/current_shell = null
var/recentpump = 0 // to prevent spammage
var/pumped = 0
var/obj/item/ammo_casing/current_shell = null
load_into_chamber()
@@ -66,7 +66,8 @@
max_shells = 2
w_class = 4.0
force = 10
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BACK
caliber = "shotgun"
origin_tech = "combat=3;materials=1"
ammo_type = "/obj/item/ammo_casing/shotgun/beanbag"
@@ -124,8 +125,8 @@
item_state = "sawnshotgun"
w_class = 3.0
item_state = "gun"
flags &= ~ONBACK //you can't sling it on your back
flags |= ONBELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
slot_flags &= ~SLOT_BACK //you can't sling it on your back
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
name = "sawn-off shotgun"
desc = "Omar's coming!"
user << "<span class='warning'>You shorten the barrel of \the [src]!</span>"

View File

@@ -492,96 +492,6 @@
else
return ..()
//The toilet does not need to pressurized but can only handle small items.
//You can also choke people by dunking them into the toilet.
/obj/machinery/disposal/toilet
name = "toilet"
desc = "A torque rotation-based, waste disposal unit for small matter."
icon_state = "toilet"
density = 0//So you can stand on it.
mode = 2
attackby(var/obj/item/I, var/mob/user)
if( !(stat & BROKEN) )
if(istype(I, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = I
if(istype(G)) // handle grabbed mob
if(ismob(G.affecting))
var/mob/GM = G.affecting
for (var/mob/V in viewers(usr))
V.show_message("[user] dunks [GM.name] into the toilet!", 3)
if(do_after(user, 30))
if(G && G.state>1 && !GM.internal)
GM.oxyloss += 5
else if(I.w_class < 4)
user.drop_item()
I.loc = src
user << "You place \the [I] into the [src]."
for(var/mob/M in viewers(src))
if(M == user)
continue
M.show_message("[user.name] places \the [I] into the [src].", 3)
else
user << "\red That item cannot be placed into the toilet."
return
MouseDrop_T(mob/target, mob/user)
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
return//Damn that list is long
for (var/mob/V in viewers(usr))
if(target == user && !user.stat)
V.show_message("[user] sits on the toilet.", 3)
if(target != user && !user.restrained())
V.show_message("[user] places [target.name] on the toilet.", 3)
target.loc = loc
return
interact(mob/user)
if(isAI(user) || isrobot(user))
return
add_fingerprint(user)
for (var/mob/V in viewers(user))
V.show_message("[user] eagerly drinks the toilet water!", 3)//Yum yum yum
return
update()
overlays = null
if( !(stat & BROKEN) )
if(flush)
overlays += image('disposal.dmi',"toilet-handle",,dir)
if( !(stat & NOPOWER) )
overlays += image('disposal.dmi',"toilet-ready",,dir)
else
icon_state = "toilet-broken"
mode = 0
flush = 0
return
process()
if( !((stat & BROKEN)||(stat & NOPOWER)) )// nothing can happen if broken or not powered.
updateDialog()
if(!flush&&contents.len)
flush++
flush()
use_power(100)// base power usage
update()
return
flush()
flick("toilet-flush", src)
var/obj/structure/disposalholder/H = new()
H.init(src)
sleep(10)
playsound(src, 'disposalflush.ogg', 50, 0, 0)
sleep(30) // To prevent spam.
H.start(src)
flush--
update()
return
// virtual disposal object
// travels through pipes in lieu of actual items
// contents will be items flushed by the disposal
@@ -600,8 +510,8 @@
// initialize a holder from the contents of a disposal unit
proc/init(var/obj/machinery/disposal/D)
if(!istype(D, /obj/machinery/disposal/toilet))//So it does not drain gas from a toilet which does not function on it.
gas = D.air_contents// transfer gas resv. into holder object
gas = D.air_contents// transfer gas resv. into holder object
// now everything inside the disposal gets put into the holder
// note AM since can contain mobs or objs

View File

@@ -252,7 +252,8 @@
w_class = 1
item_state = "electronic"
flags = FPRINT | TABLEPASS | ONBELT | CONDUCT
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
attack_self(mob/user as mob)
interact(user)