mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into OrganRefactor
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
var/next_attack = 0
|
||||
var/pounce_cooldown = 0
|
||||
var/pounce_cooldown_time = 30
|
||||
update_icon = 1
|
||||
var/leap_on_click = 0
|
||||
var/custom_pixel_x_offset = 0 //for admin fuckery.
|
||||
var/custom_pixel_y_offset = 0
|
||||
|
||||
@@ -928,27 +928,29 @@ var/global/list/damage_icon_parts = list()
|
||||
back.screen_loc = ui_back //TODO
|
||||
|
||||
//determine the icon to use
|
||||
var/icon/overlay_icon
|
||||
var/icon/standing
|
||||
if(back.icon_override)
|
||||
overlay_icon = back.icon_override
|
||||
standing = image("icon" = back.icon_override, "icon_state" = "[back.icon_state]")
|
||||
else if(istype(back, /obj/item/weapon/rig))
|
||||
//If this is a rig and a mob_icon is set, it will take species into account in the rig update_icon() proc.
|
||||
var/obj/item/weapon/rig/rig = back
|
||||
overlay_icon = rig.mob_icon
|
||||
standing = rig.mob_icon
|
||||
else if(back.sprite_sheets && back.sprite_sheets[species.name])
|
||||
overlay_icon = back.sprite_sheets[species.name]
|
||||
standing = image("icon" = back.sprite_sheets[species.name], "icon_state" = "[back.icon_state]")
|
||||
else
|
||||
overlay_icon = icon('icons/mob/back.dmi', "[back.icon_state]")
|
||||
standing = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]")
|
||||
|
||||
/*
|
||||
//determine state to use
|
||||
var/overlay_state
|
||||
if(back.item_state)
|
||||
overlay_state = back.item_state
|
||||
else
|
||||
overlay_state = back.icon_state
|
||||
*/
|
||||
|
||||
//create the image
|
||||
overlays_standing[BACK_LAYER] = image(icon = overlay_icon, icon_state = overlay_state)
|
||||
overlays_standing[BACK_LAYER] = standing
|
||||
else
|
||||
overlays_standing[BACK_LAYER] = null
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
health = 150
|
||||
gender = NEUTER
|
||||
|
||||
update_icon = 0
|
||||
nutrition = 700
|
||||
|
||||
see_in_dark = 8
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
assign_id(H)
|
||||
|
||||
/datum/superheroes/proc/equip(var/mob/living/carbon/human/H)
|
||||
H.fully_replace_character_name(H.real_name, name)
|
||||
H.rename_character(H.real_name, name)
|
||||
for(var/obj/item/W in H)
|
||||
if(istype(W,/obj/item/organ)) continue
|
||||
H.unEquip(W)
|
||||
@@ -218,7 +218,7 @@
|
||||
for(var/obj/item/W in target)
|
||||
if(istype(W,/obj/item/organ)) continue
|
||||
target.unEquip(W)
|
||||
target.fully_replace_character_name(target.real_name, "Generic Henchman ([rand(1, 1000)])")
|
||||
target.rename_character(target.real_name, "Generic Henchman ([rand(1, 1000)])")
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/greytide(target), slot_w_uniform)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(target), slot_shoes)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical/greytide(target), slot_l_hand)
|
||||
|
||||
@@ -114,7 +114,7 @@ var/list/ai_verbs_default = list(
|
||||
pickedName = null
|
||||
|
||||
aiPDA = new/obj/item/device/pda/ai(src)
|
||||
SetName(pickedName)
|
||||
rename_character(null, pickedName)
|
||||
anchored = 1
|
||||
canmove = 0
|
||||
density = 1
|
||||
@@ -204,19 +204,21 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
job = "AI"
|
||||
|
||||
/mob/living/silicon/ai/SetName(pickedName as text)
|
||||
..()
|
||||
/mob/living/silicon/ai/rename_character(oldname, newname)
|
||||
if(!..(oldname, newname))
|
||||
return 0
|
||||
|
||||
announcement.announcer = name
|
||||
if(oldname != real_name)
|
||||
announcement.announcer = name
|
||||
|
||||
if(eyeobj)
|
||||
eyeobj.name = "[pickedName] (AI Eye)"
|
||||
if(eyeobj)
|
||||
eyeobj.name = "[newname] (AI Eye)"
|
||||
|
||||
// Set ai pda name
|
||||
if(aiPDA)
|
||||
aiPDA.ownjob = "AI"
|
||||
aiPDA.owner = pickedName
|
||||
aiPDA.name = pickedName + " (" + aiPDA.ownjob + ")"
|
||||
// Set ai pda name
|
||||
if(aiPDA)
|
||||
aiPDA.set_name_and_job(newname, "AI")
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/Destroy()
|
||||
ai_list -= src
|
||||
@@ -998,3 +1000,11 @@ var/list/ai_verbs_default = list(
|
||||
var/obj/item/weapon/rig/rig = src.get_rig()
|
||||
if(rig)
|
||||
rig.force_rest(src)
|
||||
|
||||
/mob/living/silicon/ai/switch_to_camera(var/obj/machinery/camera/C)
|
||||
if(!C.can_use() || !is_in_chassis())
|
||||
return 0
|
||||
|
||||
eyeobj.setLoc(get_turf(C))
|
||||
client.eye = eyeobj
|
||||
return 1
|
||||
@@ -139,9 +139,9 @@
|
||||
|
||||
if(!src.eyeobj)
|
||||
src << "ERROR: Eyeobj not found. Creating new eye..."
|
||||
src.eyeobj = new(src.loc)
|
||||
src.eyeobj = new(loc)
|
||||
src.eyeobj.ai = src
|
||||
src.SetName(src.name)
|
||||
src.rename_character(null, real_name)
|
||||
|
||||
if(client && client.eye)
|
||||
client.eye = src
|
||||
|
||||
@@ -82,18 +82,14 @@
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
|
||||
//Redefining some robot procs...
|
||||
/mob/living/silicon/robot/drone/SetName(pickedName as text)
|
||||
// Would prefer to call the grandparent proc but this isn't possible, so..
|
||||
real_name = pickedName
|
||||
name = real_name
|
||||
/mob/living/silicon/robot/drone/rename_character(oldname, newname)
|
||||
// force it to not actually change most things
|
||||
return ..(newname, newname)
|
||||
|
||||
//Redefining some robot procs...
|
||||
/mob/living/silicon/robot/drone/updatename()
|
||||
real_name = "maintenance drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
/mob/living/silicon/robot/drone/get_default_name()
|
||||
return "maintenance drone ([rand(100,999)])"
|
||||
|
||||
/mob/living/silicon/robot/drone/update_icons()
|
||||
|
||||
overlays.Cut()
|
||||
if(stat == 0)
|
||||
overlays += "eyes-[icon_state]"
|
||||
|
||||
@@ -101,7 +101,7 @@ var/list/robot_verbs_default = list(
|
||||
robot_modules_background.icon_state = "block"
|
||||
robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it.
|
||||
ident = rand(1, 999)
|
||||
updatename("Default")
|
||||
rename_character(null, get_default_name())
|
||||
update_icons()
|
||||
update_headlamp()
|
||||
|
||||
@@ -159,9 +159,61 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
|
||||
/mob/living/silicon/robot/SetName(pickedName as text)
|
||||
custom_name = pickedName
|
||||
updatename()
|
||||
/mob/living/silicon/robot/rename_character(oldname, newname)
|
||||
if(!..(oldname, newname))
|
||||
return 0
|
||||
|
||||
if(oldname != real_name)
|
||||
notify_ai(3, oldname, newname)
|
||||
custom_name = (newname != get_default_name()) ? newname : null
|
||||
setup_PDA()
|
||||
|
||||
//We also need to update name of internal camera.
|
||||
if (camera)
|
||||
camera.c_tag = newname
|
||||
|
||||
//Check for custom sprite
|
||||
if(!custom_sprite)
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = text2list(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = text2list(line, ";")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2)
|
||||
continue;
|
||||
|
||||
if(Entry[1] == src.ckey && Entry[2] == src.real_name) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
icon = 'icons/mob/custom-synthetic.dmi'
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/proc/get_default_name(var/prefix as text)
|
||||
if(prefix)
|
||||
modtype = prefix
|
||||
if(mmi)
|
||||
if(istype(mmi, /obj/item/device/mmi/posibrain))
|
||||
braintype = "Android"
|
||||
else
|
||||
braintype = "Cyborg"
|
||||
else
|
||||
braintype = "Robot"
|
||||
|
||||
if(custom_name)
|
||||
return custom_name
|
||||
else
|
||||
return "[modtype] [braintype]-[num2text(ident)]"
|
||||
|
||||
/mob/living/silicon/robot/verb/Namepick()
|
||||
set category = "Robot Commands"
|
||||
if(custom_name)
|
||||
return 0
|
||||
|
||||
rename_self(braintype, 1)
|
||||
|
||||
/mob/living/silicon/robot/proc/sync()
|
||||
if(lawupdate && connected_ai)
|
||||
@@ -172,7 +224,7 @@ var/list/robot_verbs_default = list(
|
||||
/mob/living/silicon/robot/proc/setup_PDA()
|
||||
if (!rbPDA)
|
||||
rbPDA = new/obj/item/device/pda/ai(src)
|
||||
rbPDA.set_name_and_job(custom_name,braintype)
|
||||
rbPDA.set_name_and_job(real_name, braintype)
|
||||
if(scrambledcodes)
|
||||
var/datum/data/pda/app/messenger/M = rbPDA.find_program(/datum/data/pda/app/messenger)
|
||||
if(M)
|
||||
@@ -300,13 +352,12 @@ var/list/robot_verbs_default = list(
|
||||
icon_state = "droidcombat"
|
||||
|
||||
if("Peacekeeper")
|
||||
module= new /obj/item/weapon/robot_module/peacekeeper(src)
|
||||
module = new /obj/item/weapon/robot_module/peacekeeper(src)
|
||||
icon_state = "droidpeace"
|
||||
module.channels = list()
|
||||
icon_state = "droidpeace"
|
||||
|
||||
if("Hunter")
|
||||
updatename(module)
|
||||
module = new /obj/item/weapon/robot_module/alien/hunter(src)
|
||||
hands.icon_state = "standard"
|
||||
icon = "icons/mob/alien.dmi"
|
||||
@@ -326,7 +377,7 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
hands.icon_state = lowertext(modtype)
|
||||
feedback_inc("cyborg_[lowertext(modtype)]",1)
|
||||
updatename()
|
||||
rename_character(real_name, get_default_name())
|
||||
|
||||
if(modtype == "Medical" || modtype == "Security" || modtype == "Combat" || modtype == "Peacekeeper")
|
||||
status_flags &= ~CANPUSH
|
||||
@@ -335,64 +386,6 @@ var/list/robot_verbs_default = list(
|
||||
radio.config(module.channels)
|
||||
notify_ai(2)
|
||||
|
||||
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
|
||||
if(prefix)
|
||||
modtype = prefix
|
||||
if(mmi)
|
||||
if(istype(mmi, /obj/item/device/mmi/posibrain))
|
||||
braintype = "Android"
|
||||
else
|
||||
braintype = "Cyborg"
|
||||
else
|
||||
braintype = "Robot"
|
||||
|
||||
var/changed_name = ""
|
||||
if(custom_name)
|
||||
changed_name = custom_name
|
||||
else
|
||||
changed_name = "[modtype] [braintype]-[num2text(ident)]"
|
||||
real_name = changed_name
|
||||
name = real_name
|
||||
|
||||
// if we've changed our name, we also need to update the display name for our PDA
|
||||
setup_PDA()
|
||||
|
||||
//We also need to update name of internal camera.
|
||||
if (camera)
|
||||
camera.c_tag = changed_name
|
||||
|
||||
if(!custom_sprite) //Check for custom sprite
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = text2list(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = text2list(line, ";")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2)
|
||||
continue;
|
||||
|
||||
if(Entry[1] == src.ckey && Entry[2] == src.real_name) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
icon = 'icons/mob/custom-synthetic.dmi'
|
||||
|
||||
/mob/living/silicon/robot/verb/Namepick()
|
||||
set category = "Robot Commands"
|
||||
if(custom_name)
|
||||
return 0
|
||||
|
||||
spawn(0)
|
||||
var/newname
|
||||
newname = sanitize(copytext(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text,1,MAX_NAME_LEN))
|
||||
if (newname != "")
|
||||
notify_ai(3, name, newname)
|
||||
custom_name = newname
|
||||
|
||||
updatename()
|
||||
update_icons()
|
||||
|
||||
//for borg hotkeys, here module refers to borg inv slot, not core module
|
||||
/mob/living/silicon/robot/verb/cmd_toggle_module(module as num)
|
||||
set name = "Toggle Module"
|
||||
@@ -1303,7 +1296,37 @@ var/list/robot_verbs_default = list(
|
||||
else
|
||||
src << "Your icon has been set. You now require a module reset to change it."
|
||||
|
||||
/mob/living/silicon/robot/proc/notify_ai(var/notifytype, var/oldname, var/newname)
|
||||
if(!connected_ai)
|
||||
return
|
||||
switch(notifytype)
|
||||
if(1) //New Cyborg
|
||||
connected_ai << "<br><br><span class='notice'>NOTICE - New cyborg connection detected: <a href='byond://?src=\ref[connected_ai];track2=\ref[connected_ai];track=\ref[src]'>[name]</a></span><br>"
|
||||
if(2) //New Module
|
||||
connected_ai << "<br><br><span class='notice'>NOTICE - Cyborg module change detected: [name] has loaded the [designation] module.</span><br>"
|
||||
if(3) //New Name
|
||||
connected_ai << "<br><br><span class='notice'>NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].</span><br>"
|
||||
|
||||
/mob/living/silicon/robot/proc/disconnect_from_ai()
|
||||
if(connected_ai)
|
||||
sync() // One last sync attempt
|
||||
connected_ai.connected_robots -= src
|
||||
connected_ai = null
|
||||
|
||||
/mob/living/silicon/robot/proc/connect_to_ai(var/mob/living/silicon/ai/AI)
|
||||
if(AI && AI != connected_ai)
|
||||
disconnect_from_ai()
|
||||
connected_ai = AI
|
||||
connected_ai.connected_robots |= src
|
||||
notify_ai(1)
|
||||
sync()
|
||||
|
||||
/mob/living/silicon/robot/adjustOxyLoss(var/amount)
|
||||
if (suiciding)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/deathsquad
|
||||
base_icon = "nano_bloodhound"
|
||||
icon_state = "nano_bloodhound"
|
||||
lawupdate = 0
|
||||
scrambledcodes = 1
|
||||
@@ -1350,10 +1373,10 @@ var/list/robot_verbs_default = list(
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/syndicate
|
||||
base_icon = "syndie_bloodhound"
|
||||
icon_state = "syndie_bloodhound"
|
||||
lawupdate = 0
|
||||
scrambledcodes = 1
|
||||
modtype = "Synd"
|
||||
faction = list("syndicate")
|
||||
designation = "Syndicate Assault"
|
||||
modtype = "Syndicate"
|
||||
@@ -1384,7 +1407,9 @@ var/list/robot_verbs_default = list(
|
||||
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
|
||||
|
||||
/mob/living/silicon/robot/syndicate/medical
|
||||
base_icon = "syndi-medi"
|
||||
icon_state = "syndi-medi"
|
||||
modtype = "Syndicate Medical"
|
||||
designation = "Syndicate Medical"
|
||||
playstyle_string = "<span class='userdanger'>You are a Syndicate medical cyborg!</span><br>\
|
||||
<b>You are armed with powerful medical tools to aid you in your mission: help the operatives secure the nuclear authentication disk. \
|
||||
@@ -1397,68 +1422,40 @@ var/list/robot_verbs_default = list(
|
||||
..()
|
||||
module = new /obj/item/weapon/robot_module/syndicate_medical(src)
|
||||
|
||||
/mob/living/silicon/robot/proc/notify_ai(var/notifytype, var/oldname, var/newname)
|
||||
if(!connected_ai)
|
||||
return
|
||||
switch(notifytype)
|
||||
if(1) //New Cyborg
|
||||
connected_ai << "<br><br><span class='notice'>NOTICE - New cyborg connection detected: <a href='byond://?src=\ref[connected_ai];track2=\ref[connected_ai];track=\ref[src]'>[name]</a></span><br>"
|
||||
if(2) //New Module
|
||||
connected_ai << "<br><br><span class='notice'>NOTICE - Cyborg module change detected: [name] has loaded the [designation] module.</span><br>"
|
||||
if(3) //New Name
|
||||
connected_ai << "<br><br><span class='notice'>NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].</span><br>"
|
||||
|
||||
/mob/living/silicon/robot/proc/disconnect_from_ai()
|
||||
if(connected_ai)
|
||||
sync() // One last sync attempt
|
||||
connected_ai.connected_robots -= src
|
||||
connected_ai = null
|
||||
|
||||
/mob/living/silicon/robot/proc/connect_to_ai(var/mob/living/silicon/ai/AI)
|
||||
if(AI && AI != connected_ai)
|
||||
disconnect_from_ai()
|
||||
connected_ai = AI
|
||||
connected_ai.connected_robots |= src
|
||||
notify_ai(1)
|
||||
sync()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/combat/New()
|
||||
..()
|
||||
module = new /obj/item/weapon/robot_module/combat(src)
|
||||
module.channels = list("Security" = 1)
|
||||
/mob/living/silicon/robot/combat
|
||||
base_icon = "droidcombat"
|
||||
icon_state = "droidcombat"
|
||||
modtype = "Combat"
|
||||
designation = "Combat"
|
||||
|
||||
/mob/living/silicon/robot/combat/init()
|
||||
..()
|
||||
module = new /obj/item/weapon/robot_module/combat(src)
|
||||
module.channels = list("Security" = 1)
|
||||
//languages
|
||||
module.add_languages(src)
|
||||
//subsystems
|
||||
module.add_subsystems(src)
|
||||
|
||||
updatename()
|
||||
|
||||
status_flags &= ~CANPUSH
|
||||
|
||||
radio.config(module.channels)
|
||||
notify_ai(2)
|
||||
|
||||
/mob/living/silicon/robot/peacekeeper/New()
|
||||
..()
|
||||
module = new /obj/item/weapon/robot_module/peacekeeper(src)
|
||||
/mob/living/silicon/robot/peacekeeper
|
||||
base_icon = "droidpeace"
|
||||
icon_state = "droidpeace"
|
||||
modtype = "Peacekeeper"
|
||||
designation = "Peacekeeper"
|
||||
|
||||
/mob/living/silicon/robot/peacekeeper/init()
|
||||
..()
|
||||
module = new /obj/item/weapon/robot_module/peacekeeper(src)
|
||||
//languages
|
||||
module.add_languages(src)
|
||||
//subsystems
|
||||
module.add_subsystems(src)
|
||||
|
||||
updatename()
|
||||
|
||||
status_flags &= ~CANPUSH
|
||||
|
||||
notify_ai(2)
|
||||
|
||||
/mob/living/silicon/robot/adjustOxyLoss(var/amount)
|
||||
if (suiciding)
|
||||
..()
|
||||
notify_ai(2)
|
||||
@@ -50,9 +50,14 @@
|
||||
AH.unregister(src)
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/proc/SetName(pickedName as text)
|
||||
real_name = pickedName
|
||||
/mob/living/silicon/rename_character(oldname, newname)
|
||||
// we actually don't want it changing minds and stuff
|
||||
if(!newname)
|
||||
return 0
|
||||
|
||||
real_name = newname
|
||||
name = real_name
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/proc/show_laws()
|
||||
return
|
||||
|
||||
@@ -414,25 +414,26 @@
|
||||
else if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
|
||||
if(istype(O, /obj/item/weapon/kitchen/knife))
|
||||
harvest()
|
||||
else if(istype(O) && istype(user) && !O.attack(src, user))
|
||||
else
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
var/damage = 0
|
||||
if(O.force)
|
||||
if(O.force >= force_threshold)
|
||||
damage = O.force
|
||||
if (O.damtype == STAMINA)
|
||||
damage = 0
|
||||
visible_message("<span class='danger'>[user] has [O.attack_verb.len ? "[pick(O.attack_verb)]": "attacked"] [src] with [O]!</span>",\
|
||||
"<span class='userdanger'>[user] has [O.attack_verb.len ? "[pick(O.attack_verb)]": "attacked"] you with [O]!</span>")
|
||||
if(istype(O) && istype(user) && !O.attack(src, user))
|
||||
var/damage = 0
|
||||
if(O.force)
|
||||
if(O.force >= force_threshold)
|
||||
damage = O.force
|
||||
if (O.damtype == STAMINA)
|
||||
damage = 0
|
||||
visible_message("<span class='danger'>[user] has [O.attack_verb.len ? "[pick(O.attack_verb)]": "attacked"] [src] with [O]!</span>",\
|
||||
"<span class='userdanger'>[user] has [O.attack_verb.len ? "[pick(O.attack_verb)]": "attacked"] you with [O]!</span>")
|
||||
else
|
||||
visible_message("<span class='danger'>[O] bounces harmlessly off of [src].</span>",\
|
||||
"<span class='userdanger'>[O] bounces harmlessly off of [src].</span>")
|
||||
playsound(loc, O.hitsound, 50, 1, -1)
|
||||
else
|
||||
visible_message("<span class='danger'>[O] bounces harmlessly off of [src].</span>",\
|
||||
"<span class='userdanger'>[O] bounces harmlessly off of [src].</span>")
|
||||
playsound(loc, O.hitsound, 50, 1, -1)
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] gently taps [src] with [O].</span>",\
|
||||
"<span class='warning'>This weapon is ineffective, it does no damage.</span>")
|
||||
adjustBruteLoss(damage)
|
||||
user.visible_message("<span class='warning'>[user] gently taps [src] with [O].</span>",\
|
||||
"<span class='warning'>This weapon is ineffective, it does no damage.</span>")
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
|
||||
/mob/living/simple_animal/movement_delay()
|
||||
|
||||
@@ -199,8 +199,6 @@
|
||||
|
||||
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
|
||||
|
||||
var/update_icon = 1 //Set to 1 to trigger update_icons() at the next life() call
|
||||
|
||||
var/status_flags = CANSTUN|CANWEAKEN|CANPARALYSE|CANPUSH //bitflags defining which status effects can be inflicted (replaces canweaken, canstun, etc)
|
||||
|
||||
var/area/lastarea = null
|
||||
|
||||
@@ -557,10 +557,81 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
|
||||
check_eye(src)
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/switch_to_camera(var/obj/machinery/camera/C)
|
||||
if(!C.can_use() || !is_in_chassis())
|
||||
/mob/proc/rename_character(oldname, newname)
|
||||
if(!newname)
|
||||
return 0
|
||||
real_name = newname
|
||||
name = newname
|
||||
if(mind)
|
||||
mind.name = newname
|
||||
if(dna)
|
||||
dna.real_name = real_name
|
||||
|
||||
eyeobj.setLoc(get_turf(C))
|
||||
client.eye = eyeobj
|
||||
if(oldname)
|
||||
//update the datacore records! This is goig to be a bit costly.
|
||||
for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked))
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields["name"] == oldname)
|
||||
R.fields["name"] = newname
|
||||
break
|
||||
|
||||
//update our pda and id if we have them on our person
|
||||
var/list/searching = GetAllContents(searchDepth = 3)
|
||||
var/search_id = 1
|
||||
var/search_pda = 1
|
||||
|
||||
for(var/A in searching)
|
||||
if( search_id && istype(A,/obj/item/weapon/card/id) )
|
||||
var/obj/item/weapon/card/id/ID = A
|
||||
if(ID.registered_name == oldname)
|
||||
ID.registered_name = newname
|
||||
ID.name = "[newname]'s ID Card ([ID.assignment])"
|
||||
if(!search_pda) break
|
||||
search_id = 0
|
||||
|
||||
else if( search_pda && istype(A,/obj/item/device/pda) )
|
||||
var/obj/item/device/pda/PDA = A
|
||||
if(PDA.owner == oldname)
|
||||
PDA.owner = newname
|
||||
PDA.name = "PDA-[newname] ([PDA.ownjob])"
|
||||
if(!search_id) break
|
||||
search_pda = 0
|
||||
|
||||
//Fixes renames not being reflected in objective text
|
||||
var/list/O = subtypesof(/datum/objective)
|
||||
var/length
|
||||
var/pos
|
||||
for(var/datum/objective/objective in O)
|
||||
if(objective.target != mind) continue
|
||||
length = lentext(oldname)
|
||||
pos = findtextEx(objective.explanation_text, oldname)
|
||||
objective.explanation_text = copytext(objective.explanation_text, 1, pos)+newname+copytext(objective.explanation_text, pos+length)
|
||||
return 1
|
||||
|
||||
/mob/proc/rename_self(var/role, var/allow_numbers=0)
|
||||
spawn(0)
|
||||
var/oldname = real_name
|
||||
|
||||
var/time_passed = world.time
|
||||
var/newname
|
||||
|
||||
for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name.
|
||||
newname = input(src,"You are a [role]. Would you like to change your name to something else?", "Name change",oldname) as text
|
||||
if((world.time-time_passed)>300)
|
||||
return //took too long
|
||||
newname = reject_bad_name(newname,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
|
||||
|
||||
for(var/mob/living/M in player_list)
|
||||
if(M == src)
|
||||
continue
|
||||
if(!newname || M.real_name == newname)
|
||||
newname = null
|
||||
break
|
||||
if(newname)
|
||||
break //That's a suitable name!
|
||||
src << "Sorry, that [role]-name wasn't appropriate, please try another. It's possibly too long/short, has bad characters or is already taken."
|
||||
|
||||
if(!newname) //we'll stick with the oldname then
|
||||
return
|
||||
|
||||
rename_character(oldname, newname)
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
O.add_ai_verbs()
|
||||
|
||||
O.rename_self("ai",1)
|
||||
O.rename_self("AI",1)
|
||||
spawn
|
||||
qdel(src)
|
||||
return O
|
||||
|
||||
Reference in New Issue
Block a user