Fixed damagetypes not working in admin investigate (The (?) button when someone adminhelps)

Committing for Zekkeit/39kk9t
- Attack logs now display the reagents the pill/snack had when you forced it down someone's throat.
- List entries can now be edited and deleted! (don't try editing any of the contents list entries, it spits a runtime and I don't know how to make it uneditable)
- Fix for issue 598. Now pAI carriers can re-enable the pAI radio settings.
- Adminmoreinfo now displays the status of the mob.
- Added a confirmation message to unjobbanning from the Display Job bans panel.
- When being exposed to a virus, resistances are now taken into account. In addition, list entries that contained a virus that has been cured are now deleted.

Proposed commit: http://nanotrasen.com/phpBB3/viewtopic.php?f=16&t=9262

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4008 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-07-07 19:32:31 +00:00
parent a7baf04430
commit 22c872a2a3
6 changed files with 57 additions and 41 deletions
+20 -9
View File
@@ -576,11 +576,12 @@ var/global/BSACooldown = 0
if (href_list["removejobban"])
if ((src.rank in list("Game Admin", "Game Master" )))
var/t = href_list["removejobban"]
if(t)
log_admin("[key_name(usr)] removed [t]")
message_admins("\blue [key_name_admin(usr)] removed [t]", 1)
jobban_remove(t)
href_list["ban"] = 1 // lets it fall through and refresh
if(input(alert("Do you want to unjobban [t]?","Unjobban confirmation", "Yes", "No") == "Yes")) //No more misclicks! Unless you do it twice.
if(t)
log_admin("[key_name(usr)] removed [t]")
message_admins("\blue [key_name_admin(usr)] removed [t]", 1)
jobban_remove(t)
href_list["ban"] = 1 // lets it fall through and refresh
if (href_list["newban"])
if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
@@ -1133,6 +1134,7 @@ var/global/BSACooldown = 0
return
if(src && src.owner)
// //world <<"Passed the owner-check. Owner is [src.owner]. The mob is [M]."
var/location_description = ""
var/special_role_description = ""
var/health_description = ""
@@ -1140,10 +1142,11 @@ var/global/BSACooldown = 0
//Location
if(T && isturf(T))
// //world <<"Has a location."
if(T.loc && isarea(T.loc))
location_description = "([T.x], [T.y], [T.z] in area <b>[T.loc]</b>)"
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area <b>[T.loc]</b>)"
else
location_description = "([T.x], [T.y], [T.z])"
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])"
//Job + antagonist
if(M.mind)
@@ -1153,11 +1156,19 @@ var/global/BSACooldown = 0
//Health
if(isliving(M))
var/mob/living/L
health_description = "Oxy: [L.oxyloss] - Tox: [L.toxloss] - Fire: [L.fireloss] - Brute: [L.bruteloss] - Clone: [L.cloneloss] - Brain: [L.brainloss]"
var/mob/living/L = M
var/status
switch (M.stat)
if (0) status = "Alive"
if (1) status = "\yellow Unconscious"
if (2) status = "\red Dead"
health_description = "Status - [status]"
health_description += "<BR>Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]"
else
// world <<"Has no health."
health_description = "This mob type has no health to speak of."
// world <<"Displaying info about the mob..."
src.owner << "<b>Info about [M.name]:</b> "
src.owner << "Mob type = [M.type]; Damage = [health_description]"
src.owner << "Name = <b>[M.name]</b>; Real_name = [M.real_name]; Original_name = [M.original_name]; Key = <b>[M.key]</b>;"
+14 -21
View File
@@ -127,7 +127,6 @@ var/list/forbidden_varedit_object_types = list(
if(!istype(L,/list)) src << "Not a List."
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
var/list/names = sortList(L)
var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)"
@@ -211,10 +210,10 @@ var/list/forbidden_varedit_object_types = list(
var/class = "text"
if(src.holder && src.holder.marked_datum)
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])")
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])", "DELETE FROM LIST")
else
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default")
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default", "DELETE FROM LIST")
if(!class)
return
@@ -222,51 +221,45 @@ var/list/forbidden_varedit_object_types = list(
if(holder.marked_datum && class == "marked datum ([holder.marked_datum.type])")
class = "marked datum"
switch(class)
switch(class) //Spits a runtime error if you try to modify an entry in the contents list. Dunno how to fix it, yet.
if("list")
mod_list(variable)
if("restore to default")
variable = initial(variable)
L[L.Find(variable)]=initial(variable)
if("edit referenced object")
modify_variables(variable)
if("(DELETE FROM LIST)")
if("DELETE FROM LIST")
L -= variable
return
if("text")
variable = input("Enter new text:","Text",\
variable) as text
L[L.Find(variable)] = input("Enter new text:","Text") as text
if("num")
variable = input("Enter new number:","Num",\
variable) as num
L[L.Find(variable)] = input("Enter new number:","Num") as num
if("type")
variable = input("Enter type:","Type",variable) \
in typesof(/obj,/mob,/area,/turf)
L[L.Find(variable)] = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
if("reference")
variable = input("Select reference:","Reference",\
variable) as mob|obj|turf|area in world
L[L.Find(variable)] = input("Select reference:","Reference") as mob|obj|turf|area in world
if("mob reference")
variable = input("Select reference:","Reference",\
variable) as mob in world
L[L.Find(variable)] = input("Select reference:","Reference") as mob in world
if("file")
variable = input("Pick file:","File",variable) \
as file
L[L.Find(variable)] = input("Pick file:","File") as file
if("icon")
variable = input("Pick icon:","Icon",variable) \
as icon
L[L.Find(variable)] = input("Pick icon:","Icon") as icon
if("marked datum")
variable = holder.marked_datum
L[L.Find(variable)] = holder.marked_datum
/client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace")
+15 -8
View File
@@ -694,6 +694,13 @@
afterattack(obj/target, mob/user , flag)
return
proc/reagentlist(var/obj/item/weapon/reagent_containers/snack) //Attack logs for regents in pills
var/data
if(snack.reagents.reagent_list && snack.reagents.reagent_list.len) //find a reagent list if there is and check if it has entries
for (var/datum/reagent/R in snack.reagents.reagent_list) //no reagents will be left behind
data += "[R.id]([R.volume] units); " //Using IDs because SOME chemicals(I'm looking at you, chlorhydrate-beer) have the same names as other chemicals.
return data
else return "No reagents"
////////////////////////////////////////////////////////////////////////////////
/// (Mixing)Glass.
////////////////////////////////////////////////////////////////////////////////
@@ -1461,8 +1468,8 @@
if(!do_mob(user, M)) return
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [src.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
@@ -1635,8 +1642,8 @@
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
@@ -1773,8 +1780,8 @@
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] forces [M] to swallow [src].", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
@@ -2410,8 +2417,8 @@
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: \ref[reagents]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [src.name] by [M.name] ([M.ckey]) Reagents: \ref[reagents]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [src.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
+2 -2
View File
@@ -8,7 +8,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
// This proc has some procs that should be extracted from it. I believe we can develop some helper procs from it - Rockdtben
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0, var/force_species_check=1)
// world << "Contract_disease called by [src] with virus [virus]"
if(stat >=2) return
if(stat >=2 || src.resistances.Find(virus.type)) return
//This gives a chance to re-infect cured/vaccinated mobs
// if(virus.type in resistances)
@@ -59,7 +59,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
clothing_areas[Covers] += Clothing
*/
if(prob(15/virus.permeability_mod)) return //the power of immunity compels this disease!
if(prob(15/virus.permeability_mod)) return //the power of immunity compels this disease! but then you forgot resistances
var/obj/item/clothing/Cl = null
var/passed = 1