Merge pull request #51 from Aurorastation/development

Codecatch
This commit is contained in:
SoundScopes
2015-09-02 18:54:02 +01:00
33 changed files with 694 additions and 837 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ datum/sqlnews/proc/update() //Updates the stored variables and preppes it for a
fails++
return
var/DBQuery/query = dbcon.NewQuery("SELECT id, publishtime FROM ss13_news WHERE isnull(notpublishing) ORDER BY publishtime ASC LIMIT [count],1")
var/DBQuery/query = dbcon.NewQuery("SELECT id, publishtime FROM ss13_news WHERE status = '2' ORDER BY publishtime ASC LIMIT [count],1")
query.Execute()
if(!query.RowCount())
@@ -76,6 +76,27 @@
if(target)
ManualFollow(target)
if (href_list["follow"])
var/atom/target = locate(href_list["follow"])
if(target)
ManualFollow(target)
if (href_list["jump"])
var/mob/target = locate(href_list["jump"])
var/mob/A = usr;
A << "Teleporting to [target]..."
if(target && target != usr)
spawn(0)
var/turf/pos = get_turf(A)
var/turf/T=get_turf(target)
if(T != pos)
if(!T)
return
if(!client)
return
loc = T
following = null
..()
/mob/dead/attackby(obj/item/W, mob/user)
@@ -11,6 +11,7 @@
construction_time = 75
var/searching = 0
var/askDelay = 10 * 60 * 1
var/list/ghost_volunteers[0]
req_access = list(access_robotics)
locked = 0
mecha = null//This does not appear to be used outside of reference in mecha.dm.
@@ -23,31 +24,36 @@
//Start the process of searching for a new user.
user << "\blue You carefully locate the manual activation switch and start the positronic brain's boot process."
icon_state = "posibrain-searching"
ghost_volunteers.Cut()
src.searching = 1
src.request_player()
spawn(600) reset_search()
spawn(600)
if(ghost_volunteers.len)
var/mob/dead/observer/O = pick(ghost_volunteers)
if(istype(O) && O.client && O.key)
transfer_personality(O)
reset_search()
/obj/item/device/mmi/posibrain/proc/request_player()
for(var/mob/dead/observer/O in player_list)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
continue
if(jobban_isbanned(O, "pAI"))
continue
if(O.client)
if(O.client.prefs.be_special & BE_PAI)
question(O.client)
/obj/item/device/mmi/posibrain/proc/question(var/client/C)
spawn(0)
if(!C) return
var/response = alert(C, "Someone is requesting a personality for a positronic brain. Would you like to play as one?", "Positronic brain request", "Yes", "No", "Never for this round")
if(!C || brainmob.key || 0 == searching) return //handle logouts that happen whilst the alert is waiting for a response, and responses issued after a brain has been located.
if(response == "Yes")
transfer_personality(C.mob)
else if (response == "Never for this round")
C.prefs.be_special ^= BE_PAI
if(check_observer(O))
O << "\blue <b>\A [src] has been activated. (<a href='?src=\ref[O];jump=\ref[src]'>Teleport</a> | <a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)"
/obj/item/device/mmi/posibrain/proc/check_observer(var/mob/dead/observer/test)
if (!test) // no person ?
return
if (!test.client) // is someone actually home?
return
if (!test.client.prefs.be_special & BE_PAI) // do they want to be a pAI?
return
if(test.has_enabled_antagHUD == 1 && config.antag_hud_restricted) // have they activated the antagHUD?
return
if ((jobban_isbanned(test, "Cyborg") || jobban_isbanned(test,"nonhumandept")) && !is_alien_whitelisted(test,"Machine")) // if you can't play as either role that uses posibrains, then you can't get into a posibrain
return
return TRUE
/obj/item/device/mmi/posibrain/transfer_identity(var/mob/living/carbon/H)
/*
Positronic brains should have posibrain-like name, instead of human-MMIlike names. -- ATL
@@ -67,8 +73,20 @@
icon_state = "posibrain-occupied"
return
/obj/item/device/mmi/posibrain/proc/get_possible_uses_string(var/mob/test)
if (!(jobban_isbanned(test, "Cyborg") || jobban_isbanned(test,"nonhumandept")))
if (is_alien_whitelisted(test,"Machine"))
return "This posibrain's personality is compatible with assignment to either a tool-robot or a shell."
else
return "This posibrain's personality is compatible only with tool-robots."
else
if (is_alien_whitelisted(test,"Machine"))
return "This posibrain's personality is compatible only with shells."
else
return "This posibrain's personality is not compatible with any chassis. Something has gone wrong. Please call a bluespace technician to correct the issue."
/obj/item/device/mmi/posibrain/proc/transfer_personality(var/mob/candidate)
var/uses = get_possible_uses_string(candidate)
src.searching = 0
src.brainmob.mind = candidate.mind
src.brainmob.ckey = candidate.ckey
@@ -78,12 +96,43 @@
src.brainmob << "<b>Remember, the purpose of your existence is to serve the crew and the station. Above all else, do no harm.</b>"
src.brainmob << "<b>Use say :b to speak to other artificial intelligences.</b>"
src.brainmob.mind.assigned_role = "Positronic Brain"
var/turf/T = get_turf_or_move(src.loc)
for (var/mob/M in viewers(T))
M.show_message("\blue The positronic brain chimes quietly.")
M.show_message("\blue The positronic brain chimes quietly as it loads a new personality. [uses]")
icon_state = "posibrain-occupied"
/obj/item/device/mmi/posibrain/Topic(href,href_list)
if("signup" in href_list)
var/mob/dead/observer/O = locate(href_list["signup"])
if(!O) return
volunteer(O)
/obj/item/device/mmi/posibrain/proc/volunteer(var/mob/dead/observer/O)
if(!searching)
O << "Not looking for a ghost, yet."
return
if(!istype(O))
O << "\red Error."
return
if(O in ghost_volunteers)
O << "\blue Removed from registration list."
ghost_volunteers.Remove(O)
return
if(!check_observer(O))
O << "\red You cannot be \a [src]."
return
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
O << "\red Upon using the antagHUD you forfeited the ability to join the round."
return
if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept"))
O << "\red You are job banned from this role."
return
O.<< "\blue You've been added to the list of ghosts that may become this [src]. Click again to unvolunteer."
ghost_volunteers.Add(O)
/obj/item/device/mmi/posibrain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer.
if(src.brainmob && src.brainmob.key) return
+19 -29
View File
@@ -26,6 +26,13 @@ var/datum/paiController/paiController // Global handler for pAI candidates
var/askDelay = 10 * 60 * 1 // One minute [ms * sec * min]
/datum/paiController/Topic(href, href_list[])
if("signup" in href_list)
var/mob/dead/observer/O = locate(href_list["signup"])
if(!O) return
if(!check_recruit(O)) return
recruitWindow(O)
return
if(href_list["download"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"])
var/obj/item/device/paicard/card = locate(href_list["device"])
@@ -346,33 +353,16 @@ var/datum/paiController/paiController // Global handler for pAI candidates
/datum/paiController/proc/requestRecruits(var/mob/user)
inquirer = user
for(var/mob/dead/observer/O in player_list)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
continue
if(jobban_isbanned(O, "pAI"))
continue
if(asked.Find(O.key))
if(world.time < asked[O.key] + askDelay)
continue
else
asked.Remove(O.key)
if(O.client)
if(O.client.prefs.be_special & BE_PAI)
question(O.client)
/datum/paiController/proc/question(var/client/C)
spawn(0)
if(!C) return
asked.Add(C.key)
asked[C.key] = world.time
var/response = alert(C, "[inquirer] is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round")
if(!C) return //handle logouts that happen whilst the alert is waiting for a response.
if(response == "Yes")
recruitWindow(C.mob)
else if (response == "Never for this round")
var/warning = alert(C, "Are you sure? This action will be undoable and you will need to wait until next round.", "You sure?", "Yes", "No")
if(warning == "Yes")
asked[C.key] = INFINITY
else
question(C)
if(O.client && O.client.prefs.be_special & BE_PAI)
if(check_recruit(O))
O << "\blue <b>A pAI card is looking for personalities. (<a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)</b>"
/datum/paiController/proc/check_recruit(var/mob/dead/observer/O)
if(jobban_isbanned(O, "pAI") || jobban_isbanned(O,"nonhumandept"))
return
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
return
if(O.client)
return TRUE
@@ -49,7 +49,7 @@
set name = "Drop Item"
set desc = "Release an item from your magnetic gripper."
set category = "Drone"
set category = "Robot Commands"
if(!wrapped)
//There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z
@@ -64,14 +64,14 @@
src.loc << "\red You drop \the [wrapped]."
wrapped.loc = get_turf(src)
wrapped = null
//update_icon()
update_wrapped()
/obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
return
/obj/item/weapon/gripper/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)
if(!target || !proximity) //Target is invalid or we are not adjacent.
update_wrapped()
return
//There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z
@@ -93,6 +93,7 @@
wrapped.loc = src
else
wrapped = null
update_wrapped()
return
else if(istype(target,/obj/item)) //Check that we're not pocketing a mob.
@@ -115,27 +116,42 @@
user << "You collect \the [I]."
I.loc = src
wrapped = I
update_wrapped()
return
else
user << "\red Your gripper cannot hold \the [target]."
update_wrapped()
else if(istype(target,/obj/machinery/power/apc))
var/obj/machinery/power/apc/A = target
if(A.opened)
if(A.cell)
wrapped = A.cell
A.cell.add_fingerprint(user)
A.cell.updateicon()
A.cell.loc = src
A.cell = null
A.charging = 0
A.update_icon()
user.visible_message("\red [user] removes the power cell from [A]!", "You remove the power cell.")
update_wrapped()
/obj/item/weapon/gripper/proc/update_wrapped()
update_name()
update_overlay()
/obj/item/weapon/gripper/proc/update_name()
name = initial(name)
if (wrapped)
name += " ([wrapped])"
/obj/item/weapon/gripper/proc/update_overlay()
overlays.Cut()
if (wrapped)
overlays+=wrapped
//TODO: Matter decompiler.
/obj/item/weapon/matter_decompiler
@@ -745,6 +745,8 @@
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
if(radio)
radio.set_emag(TRUE)
if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner))
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
del(D)
@@ -231,10 +231,8 @@
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/borg/sight/meson(src)
src.emag = new /obj/item/borg/stun(src)
src.modules += new /obj/item/weapon/rcd/borg(src)
src.modules += new /obj/item/weapon/extinguisher(src)
// src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/weapon/weldingtool/largetank(src)
src.modules += new /obj/item/weapon/screwdriver(src)
src.modules += new /obj/item/weapon/wrench(src)
@@ -244,7 +242,10 @@
src.modules += new /obj/item/device/t_scanner(src)
src.modules += new /obj/item/device/analyzer(src)
src.modules += new /obj/item/taperoll/engineering(src)
src.modules += new /obj/item/weapon/gripper(src)
src.emag = new /obj/item/borg/stun(src)
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
M.amount = 50
src.modules += M
@@ -66,4 +66,36 @@
icon_state = "critter"
icon_living = "critter"
icon_dead = "critter_dead"
attackv = "swoops"
attackv = "swoops"
// Holographic carp for the holodeck
/mob/living/simple_animal/hostile/carp/hologram
name = "space carp"
desc = "A solid light image of a ferocious, fang-bearing creature resembling a fish. It flickers inconsistently but appears to be able to affect solid matter."
icon_state = "holocarp"
icon_living = "holocarp"
icon_dead = "carp_dead"
icon_gib = "carp_gib"
meat_type = null
var/datum/effect/effect/system/spark_spread/spark_system // for when they die
/mob/living/simple_animal/hostile/carp/hologram/New(loc)
. = ..(loc)
spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
/mob/living/simple_animal/hostile/carp/hologram/death()
src.spark_system.start() // sparks for holograms! Hurray!
stat = DEAD
density = 0
. = ..()
src.visible_message("[src] sparks and then flickers out of existence.")
del(src)
/mob/living/simple_animal/hostile/carp/hologram/gib()
return death()
@@ -711,6 +711,12 @@
icon_state = "hair_messy"
species_allowed = list("Tajaran")
taj_ears_curls
name = "Tajara Curly"
icon_state = "hair_curly"
gender = FEMALE
species_allowed = list("Tajaran")
taj_ears_wife
name = "Tajara Housewife"
icon_state = "hair_wife"
+8 -7
View File
@@ -29,7 +29,8 @@ datum/synthetic_limb_cover/New( var/datum/organ/external/datum_target=null,var/i
datum/synthetic_limb_cover/proc/get_icon() // default mechanical limbs return robo versions
var/icon/temp = new /icon((coverage ? main_icon : damage_icon), "[limb_datum.icon_name][limb_datum.get_gender_string()]") // only add a gender if it's necessary
var/icon/result = icon(temp)
result.Blend(colour, ICON_ADD)
if (coverage)
result.Blend(colour, ICON_ADD)
return result
@@ -213,7 +214,8 @@ proc/create_tinted_icon(icon_name, icon_state_name, target_colour)
if (target in list("mouth","eyes")) // we don't paint these individually
target="head"
if (allowed_to_paint(human_target,user,target))
paint_organ(human_target, user, human_target.get_organ(target))
if (do_after_to_target(user,human_target,20))
paint_organ(human_target, user, human_target.get_organ(target))
/obj/item/weapon/synth_skin_spray/proc/paint_organ(mob/M, mob/user, datum/organ/external/datum_target)
@@ -229,13 +231,11 @@ proc/create_tinted_icon(icon_name, icon_state_name, target_colour)
human_target.r_facial = hair_colour_as_list[1]
human_target.g_facial = hair_colour_as_list[2]
human_target.b_facial = hair_colour_as_list[3]
human_target.h_style=random_hair_style(human_target.gender,human_target.species)
human_target.update_hair()
if (istype(datum_target,/datum/organ/external/groin)) // this is a bit reductive, but whatever
var/gender_string = input(user,"What sex do you want this shell to appear as?") in list("Male","Female")
human_target.gender = (gender_string=="Male") ? MALE : FEMALE
human_target.update_tail_showing(FALSE)
human_target.update_body(TRUE)
cartridge.current_charges--
user.visible_message("<span class='notice'>[user] has covered [M]'s [datum_target.display_name] with [cartridge.covering_description].</span>")
@@ -294,8 +294,9 @@ proc/create_tinted_icon(icon_name, icon_state_name, target_colour)
return " It looks like there are [current_charges] charges left."
/obj/item/weapon/synth_skin_cartridge/examine(mob/user)
user << src.desc + get_charges_string()
/obj/item/weapon/synth_skin_cartridge/examine()
set src in usr
usr << src.desc + get_charges_string()
/obj/item/weapon/synth_skin_cartridge/attack_self(mob/user)