Merge remote-tracking branch 'remotes/Baystation12/Baystation12/master' into work_in_progress

This commit is contained in:
Cael_Aislinn
2012-12-11 12:38:58 +10:00
32 changed files with 538 additions and 204 deletions

View File

@@ -173,26 +173,54 @@ var/global/floorIsLava = 0
/datum/player_info/var/content // text content of the information
/datum/player_info/var/timestamp // Because this is bloody annoying
#define PLAYER_NOTES_ENTRIES_PER_PAGE 50
/datum/admins/proc/PlayerNotes()
set category = "Admin"
set name = "Player Notes"
var/dat = "<B>Player notes</B><HR><table>"
if (!istype(src,/datum/admins))
src = usr.client.holder
if (!istype(src,/datum/admins))
usr << "Error: you are not an admin!"
return
PlayerNotesPage(1)
/datum/admins/proc/PlayerNotesPage(page)
var/dat = "<B>Player notes</B><HR>"
var/savefile/S=new("data/player_notes.sav")
var/list/note_keys
S >> note_keys
if(!note_keys)
dat += "No notes found."
else
dat += "<table>"
sortList(note_keys)
for(var/t in note_keys)
// Display the notes on the current page
var/number_pages = note_keys.len / PLAYER_NOTES_ENTRIES_PER_PAGE
// Emulate ceil(why does BYOND not have ceil)
if(number_pages != round(number_pages))
number_pages = round(number_pages) + 1
var/page_index = page - 1
if(page_index < 0 || page_index >= number_pages)
return
var/lower_bound = page_index * PLAYER_NOTES_ENTRIES_PER_PAGE + 1
var/upper_bound = (page_index + 1) * PLAYER_NOTES_ENTRIES_PER_PAGE
upper_bound = min(upper_bound, note_keys.len)
for(var/index = lower_bound, index <= upper_bound, index++)
var/t = note_keys[index]
dat += "<tr><td><a href='?src=\ref[src];notes=show;ckey=[t]'>[t]</a></td></tr>"
dat += "</table>"
dat += "</table><br>"
// Display a footer to select different pages
for(var/index = 1, index <= number_pages, index++)
if(index == page)
dat += "<b>"
dat += "<a href='?src=\ref[src];notes=list;index='[index]'>[index]</a> "
if(index == page)
dat += "</b>"
usr << browse(dat, "window=player_notes;size=400x400")
@@ -1123,4 +1151,4 @@ proc/move_alien_ship()
alien_ship_location = 0
else
alien_ship_location = 1
return
return

View File

@@ -2706,4 +2706,6 @@ var/list/admin_datums = list()
switch(href_list["notes"])
if("show")
show_player_info(ckey)
if("list")
PlayerNotesPage(href_list["index"])
return

View File

@@ -4,8 +4,8 @@
icon_state = "hardhat0_yellow"
flags = FPRINT | TABLEPASS
item_state = "hardhat0_yellow"
var/brightness_on = 4 //luminosity when on
var/on = 0
brightness_on = 4 //luminosity when on
light_on = 0
color = "yellow" //Determines used sprites: hardhat[on]_[color] and hardhat[on]_[color]2 (lying down sprite)
armor = list(melee = 30, bullet = 5, laser = 20,energy = 10, bomb = 20, bio = 10, rad = 20)
flags_inv = 0
@@ -15,24 +15,35 @@
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
return
on = !on
icon_state = "hardhat[on]_[color]"
item_state = "hardhat[on]_[color]"
light_on = !light_on
icon_state = "hardhat[light_on]_[color]"
item_state = "hardhat[light_on]_[color]"
if(on) user.SetLuminosity(user.luminosity + brightness_on)
else user.SetLuminosity(user.luminosity - brightness_on)
if((light_on) && (user.luminosity < brightness_on))
user.SetLuminosity(brightness_on)
else
user.SetLuminosity(search_light(user, src))
pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
if(light_on)
if (user.luminosity < brightness_on)
user.SetLuminosity(brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
dropped(mob/user)
if(on)
user.SetLuminosity(user.luminosity - brightness_on)
// user.UpdateLuminosity()
SetLuminosity(brightness_on)
if(light_on)
if ((layer <= 3) || (loc != user.loc))
user.SetLuminosity(search_light(user, src))
SetLuminosity(brightness_on)
// user.UpdateLuminosity()
equipped(mob/user, slot)
if(light_on)
if (user.luminosity < brightness_on)
user.SetLuminosity(brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
/obj/item/clothing/head/hardhat/orange

View File

@@ -122,32 +122,42 @@
color = "pumpkin"
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
var/brightness_on = 2 //luminosity when on
var/on = 0
brightness_on = 2 //luminosity when on
light_on = 0
attack_self(mob/user)
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
return
on = !on
icon_state = "hardhat[on]_[color]"
item_state = "hardhat[on]_[color]"
light_on = !light_on
icon_state = "hardhat[light_on]_[color]"
item_state = "hardhat[light_on]_[color]"
if(on) user.SetLuminosity(user.luminosity + brightness_on)
else user.SetLuminosity(user.luminosity - brightness_on)
if((light_on) && (user.luminosity < brightness_on))
user.SetLuminosity(brightness_on)
else
user.SetLuminosity(search_light(user, src))
pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
// user.UpdateLuminosity()
if(light_on)
if (user.luminosity < brightness_on)
user.SetLuminosity(brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
dropped(mob/user)
if(on)
user.SetLuminosity(user.luminosity - brightness_on)
// user.UpdateLuminosity()
SetLuminosity(brightness_on)
if(light_on)
if ((layer <= 3) || (loc != user.loc))
user.SetLuminosity(search_light(user, src))
SetLuminosity(brightness_on)
// user.UpdateLuminosity()
equipped(mob/user, slot)
if(light_on)
if (user.luminosity < brightness_on)
user.SetLuminosity(brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
/*
* Kitty ears
*/

View File

@@ -6,8 +6,8 @@
item_state = "eng_helm"
armor = list(melee = 40, bullet = 5, laser = 20,energy = 5, bomb = 35, bio = 100, rad = 100)
allowed = list(/obj/item/device/flashlight)
var/brightness_on = 4 //luminosity when on
var/on = 0
brightness_on = 4 //luminosity when on
light_on = 0
color = "engineering" //Determines used sprites: rig[on]-[color] and rig[on]-[color]2 (lying down sprite)
icon_action_button = "action_hardhat"
heat_protection = HEAD
@@ -17,24 +17,35 @@
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
return
on = !on
icon_state = "rig[on]-[color]"
light_on = !light_on
icon_state = "rig[light_on]-[color]"
// item_state = "rig[on]-[color]"
if(on) user.SetLuminosity(user.luminosity + brightness_on)
else user.SetLuminosity(user.luminosity - brightness_on)
if((light_on) && (user.luminosity < brightness_on))
user.SetLuminosity(brightness_on)
else
user.SetLuminosity(search_light(user, src))
pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
// user.UpdateLuminosity()
if(light_on)
if (user.luminosity < brightness_on)
user.SetLuminosity(brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
dropped(mob/user)
if(on)
user.SetLuminosity(user.luminosity - brightness_on)
// user.UpdateLuminosity()
SetLuminosity(brightness_on)
if(light_on)
if ((layer <= 3) || (loc != user.loc))
user.SetLuminosity(search_light(user, src))
SetLuminosity(brightness_on)
// user.UpdateLuminosity()
equipped(mob/user, slot)
if(light_on)
if (user.luminosity < brightness_on)
user.SetLuminosity(brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
/obj/item/clothing/suit/space/rig
name = "engineering hardsuit"

View File

@@ -421,19 +421,19 @@
if(!item) return //Grab processing has a chance of returning null
item.layer = initial(item.layer)
u_equip(item)
update_icons()
if(src.client)
src.client.screen -= item
//if(src.client)
//src.client.screen -= item
item.loc = src.loc
//item.loc = src.loc
if(istype(item, /obj/item))
item:dropped(src) // let it know it's been dropped
//if(istype(item, /obj/item))
//item:dropped(src) // let it know it's been dropped
//actually throw it!
if (item)
item.layer = initial(item.layer)
src.visible_message("\red [src] has thrown [item].")
if(!src.lastarea)

View File

@@ -159,9 +159,8 @@
client.screen -= W
W.loc = loc
W.dropped(src)
if(W)
W.layer = initial(W.layer)
//if(W)
//W.layer = initial(W.layer)
update_action_buttons()
return 1
@@ -592,7 +591,15 @@ It can still be worn/put on as normal.
target.internals.icon_state = "internal1"
if(slot_to_process)
if(strip_item) //Stripping an item from the mob
target.u_equip(strip_item)
var/obj/item/W = strip_item
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.dropped(target)
W.add_fingerprint(source)
if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;)
if(target.r_store)
target.u_equip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
@@ -601,6 +608,7 @@ It can still be worn/put on as normal.
if(item.mob_can_equip(target, slot_to_process, 0))
source.u_equip(item)
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
item.dropped(source)
source.update_icons()
target.update_icons()

View File

@@ -140,7 +140,7 @@
if(D.data["donor"] == src)
B = D
break
var/datum/reagent/nutriment/F = locate() in vessel.reagent_list
var/datum/reagent/nutriment/F = locate() in reagents.reagent_list
if(F != null)
if(F.volume >= 1)
// nutriment speeds it up quite a bit

View File

@@ -102,8 +102,8 @@
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
W.dropped(target)
W.add_fingerprint(source)
else
if (istype(item, /obj/item))
@@ -112,6 +112,8 @@
item.layer = 20
target.l_hand = item
item.loc = target
item.dropped(source)
item.equipped(target,target.l_hand)
if("r_hand")
if (target.r_hand)
var/obj/item/W = target.r_hand
@@ -120,8 +122,8 @@
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
W.dropped(target)
W.add_fingerprint(source)
else
if (istype(item, /obj/item))
@@ -130,6 +132,8 @@
item.layer = 20
target.r_hand = item
item.loc = target
item.dropped(source)
item.equipped(target,target.r_hand)
if("back")
if (target.back)
var/obj/item/W = target.back

View File

@@ -0,0 +1,122 @@
// A special tray for the service droid. Allow droid to pick up and drop items as if they were using the tray normally
// Click on table to unload, click on item to load. Otherwise works identically to a tray.
// Unlike the base item "tray", robotrays ONLY pick up food, drinks and condiments.
/obj/item/weapon/tray/robotray
name = "RoboTray"
desc = "An autoloading tray specialized for carrying refreshments."
/obj/item/weapon/tray/robotray/afterattack(atom/target, mob/user as mob)
if ( !target )
return
// pick up items, mostly copied from base tray pickup proc
// see code\game\objects\items\weapons\kitchen.dm line 241
if ( istype(target,/obj/item))
if ( !isturf(target.loc) ) // Don't load up stuff if it's inside a container or mob!
return
var turf/pickup = target.loc
var addedSomething = 0
for(var/obj/item/weapon/reagent_containers/food/I in pickup)
if( I != src && !I.anchored && !istype(I, /obj/item/clothing/under) && !istype(I, /obj/item/clothing/suit) && !istype(I, /obj/item/projectile) )
var/add = 0
if(I.w_class == 1.0)
add = 1
else if(I.w_class == 2.0)
add = 3
else
add = 5
if(calc_carry() + add >= max_carry)
break
I.loc = src
carrying.Add(I)
overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = 30 + I.layer)
addedSomething = 1
if ( addedSomething )
user.visible_message("\blue [user] load some items onto their service tray.")
return
// Unloads the tray, copied from base item's proc dropped() and altered
// see code\game\objects\items\weapons\kitchen.dm line 263
if ( isturf(target) || istype(target,/obj/structure/table) )
var foundtable = istype(target,/obj/structure/table/)
if ( !foundtable ) //it must be a turf!
for(var/obj/structure/table/T in target)
foundtable = 1
break
var turf/dropspot
if ( !foundtable ) // don't unload things onto walls or other silly places.
dropspot = user.loc
else if ( isturf(target) ) // they clicked on a turf with a table in it
dropspot = target
else // they clicked on a table
dropspot = target.loc
overlays = null
var droppedSomething = 0
for(var/obj/item/I in carrying)
I.loc = dropspot
carrying.Remove(I)
droppedSomething = 1
if(!foundtable && isturf(dropspot))
// if no table, presume that the person just shittily dropped the tray on the ground and made a mess everywhere!
spawn()
for(var/i = 1, i <= rand(1,2), i++)
if(I)
step(I, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
if ( droppedSomething )
if ( foundtable )
user.visible_message("\blue [user] unloads their service tray.")
else
user.visible_message("\blue [user] drops all the items on their tray.")
return ..()
// A special pen for service droids. Can be toggled to switch between normal writting mode, and paper rename mode
// Allows service droids to rename paper items.
/obj/item/weapon/pen/robopen
desc = "A black ink printing attachment with a paper naming mode."
name = "Printing Pen"
var/mode = 1
/obj/item/weapon/pen/robopen/attack_self(mob/user as mob)
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
if (mode == 1)
mode = 2
user << "Changed printing mode to 'Rename Paper'"
return
if (mode == 2)
mode = 1
user << "Changed printing mode to 'Write Paper'"
// Copied over from paper's rename verb
// see code\modules\paperwork\paper.dm line 62
/obj/item/weapon/pen/robopen/proc/RenamePaper(mob/user as mob,obj/paper as obj)
if ( !user || !paper )
return
var/n_name = input(user, "What would you like to label the paper?", "Paper Labelling", null) as text
if ( !user || !paper )
return
n_name = copytext(n_name, 1, 32)
if(( get_dist(user,paper) <= 1 && user.stat == 0))
paper.name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(user)
return

View File

@@ -170,7 +170,7 @@
..()
src.modules += new /obj/item/weapon/reagent_containers/food/drinks/beer(src)
src.modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
src.modules += new /obj/item/weapon/pen(src)
src.modules += new /obj/item/weapon/pen/robopen(src)
var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src)
M.matter = 30
@@ -179,10 +179,10 @@
src.modules += new /obj/item/weapon/reagent_containers/robodropper(src)
var/obj/item/weapon/lighter/zippo/L = new /obj/item/weapon/lighter/zippo(src)
L.lit = 1
L.light_on = 1
src.modules += L
src.modules += new /obj/item/weapon/tray(src)
src.modules += new /obj/item/weapon/tray/robotray(src)
src.modules += new /obj/item/weapon/reagent_containers/food/drinks/shaker(src)
src.emag = new /obj/item/weapon/reagent_containers/food/drinks/beer(src)

View File

@@ -264,7 +264,10 @@
clown = 1
if(istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon))
user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]")
if ( istype(P, /obj/item/weapon/pen/robopen) && P:mode == 2 )
P:RenamePaper(user,src)
else
user << 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))

View File

@@ -87,19 +87,19 @@
visible_message("\red [A.name] is hit by the [src.name] in the [def_zone]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
if(istype(firer, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]</font>")
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]</font>")
log_admin("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]")
msg_admin_attack("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
log_admin("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]")
msg_admin_attack("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]") //BS12 EDIT ALG
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src]</font>")
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src.type]</font>")
log_admin("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src]")
msg_admin_attack("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
msg_admin_attack("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src.type]") //BS12 EDIT ALG
spawn(0)
if(A)

View File

@@ -93,15 +93,27 @@
user << "\red [target] is full."
return
var/datum/reagent/refill
var/datum/reagent/refillName
if(isrobot(user))
refill = reagents.get_master_reagent_id()
refillName = reagents.get_master_reagent_name()
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You transfer [trans] units of the solution to [target]."
if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
var/mob/living/silicon/robot/bro = user
bro.cell.use(30)
var/refill = reagents.get_master_reagent_id()
spawn(600)
var/chargeAmount = max(30,4*trans)
bro.cell.use(chargeAmount)
user << "Now synthesizing [trans] units of [refillName]..."
spawn(300)
reagents.add_reagent(refill, trans)
user << "Cyborg [src] refilled."
return

View File

@@ -216,8 +216,8 @@
seed = "/obj/item/seeds/glowberryseed"
name = "bunch of glow-berries"
desc = "Nutritious!"
var/on = 1
var/brightness_on = 2 //luminosity when on
light_on = 1
brightness_on = 2 //luminosity when on
icon_state = "glowberrypile"
New()
..()