mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Numerous bugfixes.
This commit is contained in:
@@ -312,25 +312,25 @@ datum/mind
|
|||||||
if(!def_value)//If it's a custom objective, it will be an empty string.
|
if(!def_value)//If it's a custom objective, it will be an empty string.
|
||||||
def_value = "custom"
|
def_value = "custom"
|
||||||
|
|
||||||
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate","decapitate", "debrain", "protection", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom")
|
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate","decapitate", "debrain", "protection", "frame", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom")
|
||||||
if (!new_obj_type) return
|
if (!new_obj_type) return
|
||||||
|
|
||||||
var/datum/objective/new_objective = null
|
var/datum/objective/new_objective = null
|
||||||
|
|
||||||
switch (new_obj_type)
|
switch (new_obj_type)
|
||||||
if ("assassinate","protect","debrain","decapitate")
|
if ("assassinate","protection", "frame", "debrain","decapitate")
|
||||||
//To determine what to name the objective in explanation text.
|
//To determine what to name the objective in explanation text.
|
||||||
var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter.
|
// var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter.
|
||||||
var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text.
|
// var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text.
|
||||||
var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string.
|
// var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string.
|
||||||
|
|
||||||
var/list/possible_targets = list("Free objective")
|
var/list/possible_targets = list("Free objective")
|
||||||
for(var/datum/mind/possible_target in ticker.minds)
|
for(var/datum/mind/possible_target in ticker.minds)
|
||||||
if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
|
if ((possible_target != src) && possible_target.current && istype(possible_target.current, /mob/living/carbon/human))
|
||||||
possible_targets += possible_target.current
|
possible_targets += possible_target.current
|
||||||
|
|
||||||
var/mob/def_target = null
|
var/mob/def_target = null
|
||||||
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protection, /datum/objective/debrain, /datum/objective/decapitate)
|
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protection, /datum/objective/frame, /datum/objective/debrain, /datum/objective/decapitate)
|
||||||
if (objective&&(objective.type in objective_list) && objective:target)
|
if (objective&&(objective.type in objective_list) && objective:target)
|
||||||
def_target = objective:target.current
|
def_target = objective:target.current
|
||||||
|
|
||||||
@@ -339,16 +339,11 @@ datum/mind
|
|||||||
|
|
||||||
var/objective_path = text2path("/datum/objective/[new_obj_type]")
|
var/objective_path = text2path("/datum/objective/[new_obj_type]")
|
||||||
if (new_target == "Free objective")
|
if (new_target == "Free objective")
|
||||||
new_objective = new objective_path
|
new_objective = new objective_path(null,"MODE",null)
|
||||||
new_objective.owner = src
|
new_objective.owner = src
|
||||||
new_objective:target = null
|
|
||||||
new_objective.explanation_text = "Free objective"
|
|
||||||
else
|
else
|
||||||
new_objective = new objective_path
|
new_objective = new objective_path(null,"MODE",new_target:mind)
|
||||||
new_objective.owner = src
|
new_objective.owner = src
|
||||||
new_objective:target = new_target:mind
|
|
||||||
//Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops.
|
|
||||||
new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:role_alt_title ? new_target:mind:role_alt_title : new_target:mind:assigned_role)]."
|
|
||||||
|
|
||||||
if ("hijack")
|
if ("hijack")
|
||||||
new_objective = new /datum/objective/hijack
|
new_objective = new /datum/objective/hijack
|
||||||
@@ -367,13 +362,14 @@ datum/mind
|
|||||||
new_objective.owner = src
|
new_objective.owner = src
|
||||||
|
|
||||||
if ("steal")
|
if ("steal")
|
||||||
var/list/possibilities = typesof(/datum/objective/steal) - /datum/objective/steal
|
var/list/possibilities = GenerateTheft(assigned_role,src)
|
||||||
|
var/list/temp_poss = possibilities[1]
|
||||||
var/list/choices = list()
|
var/list/choices = list()
|
||||||
for(var/datum/objective/steal/name in possibilities)
|
for(var/datum/objective/steal/steal in temp_poss)
|
||||||
choices[name.explanation_text] = name
|
choices["[steal.steal_target]"] = steal
|
||||||
var/new_target = input("Select target:", "Objective target") as null|anything in choices
|
var/new_target = input("Select target:", "Objective target") as null|anything in choices
|
||||||
if (!new_target) return
|
if (!new_target) return
|
||||||
new_objective = new choices[new_target]
|
new_objective = choices[new_target]
|
||||||
new_objective.owner = src
|
new_objective.owner = src
|
||||||
|
|
||||||
if("download","capture","absorb")
|
if("download","capture","absorb")
|
||||||
|
|||||||
@@ -1167,6 +1167,10 @@ datum
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
decapitate
|
decapitate
|
||||||
|
New(var/text,var/joba,var/datum/mind/targeta)
|
||||||
|
target = targeta
|
||||||
|
job = joba
|
||||||
|
explanation_text = "Remove and recover the head of [target.current.real_name], the [target.assigned_role]."
|
||||||
proc/find_target()
|
proc/find_target()
|
||||||
..()
|
..()
|
||||||
if(target && target.current)
|
if(target && target.current)
|
||||||
@@ -1249,6 +1253,11 @@ datum
|
|||||||
|
|
||||||
|
|
||||||
debrain//I want braaaainssss
|
debrain//I want braaaainssss
|
||||||
|
New(var/text,var/joba,var/datum/mind/targeta)
|
||||||
|
target = targeta
|
||||||
|
job = joba
|
||||||
|
explanation_text = "Remove and recover the brain of [target.current.real_name], the [target.assigned_role]."
|
||||||
|
|
||||||
proc/find_target()
|
proc/find_target()
|
||||||
..()
|
..()
|
||||||
if(target && target.current)
|
if(target && target.current)
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
i++
|
i++
|
||||||
if(i%2 == 0)
|
if(i%2 == 0)
|
||||||
color = "#f2f2f2"
|
color = "#f2f2f2"
|
||||||
var/real = (M.real_name == M.original_name ? M.real_name : "[M.original_name] (as [M.real_name])")
|
var/real = (M.real_name == M.original_name ? "<b>[M.name]/[M.real_name]</b>" : "<b>[M.original_name] (as [M.name]/[M.real_name])</b>")
|
||||||
var/turf/T = get_turf(M)
|
var/turf/T = get_turf(M)
|
||||||
var/client_key = (M.key? M.key : "No key")
|
var/client_key = (M.key? M.key : "No key")
|
||||||
dat += "<tr align='center' bgcolor='[color]'><td>[M.name] \[[real]\] <br>[M.client ? M.client : "No client ([client_key])"] at ([T.x], [T.y], [T.z])</td>" // Adds current name
|
dat += "<tr align='center' bgcolor='[color]'><td>[real] <br>[M.client ? M.client : "No client ([client_key])"] at ([T.x], [T.y], [T.z])</td>" // Adds current name
|
||||||
if(isobserver(M))
|
if(isobserver(M))
|
||||||
dat += "<td>Ghost</td>"
|
dat += "<td>Ghost</td>"
|
||||||
else if(isalien(M))
|
else if(isalien(M))
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
alert("Admin jumping disabled")
|
alert("Admin jumping disabled")
|
||||||
return
|
return
|
||||||
|
|
||||||
/client/proc/jumptomob()
|
/client/proc/jumptomob(var/mob/M in world)
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Jump to Mob"
|
set name = "Jump to Mob"
|
||||||
|
|
||||||
@@ -37,12 +37,13 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
if(config.allow_admin_jump)
|
if(config.allow_admin_jump)
|
||||||
var/mobs = getmobs()
|
if(!M || !istype(M))
|
||||||
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in mobs
|
var/mobs = getmobs()
|
||||||
if(!selection)
|
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in mobs
|
||||||
return
|
if(!selection)
|
||||||
|
return
|
||||||
var/mob/M = mobs[selection]
|
|
||||||
|
M = mobs[selection]
|
||||||
var/mob/A = src.mob
|
var/mob/A = src.mob
|
||||||
var/turf/T = get_turf(M)
|
var/turf/T = get_turf(M)
|
||||||
if(T && isturf(T))
|
if(T && isturf(T))
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
else
|
else
|
||||||
alert("Admin jumping disabled")
|
alert("Admin jumping disabled")
|
||||||
|
|
||||||
/client/proc/Getmob()
|
/client/proc/Getmob(var/mob/M)
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Get Mob"
|
set name = "Get Mob"
|
||||||
set desc = "Mob to teleport"
|
set desc = "Mob to teleport"
|
||||||
@@ -102,11 +103,12 @@
|
|||||||
src << "Only administrators may use this command."
|
src << "Only administrators may use this command."
|
||||||
return
|
return
|
||||||
if(config.allow_admin_jump)
|
if(config.allow_admin_jump)
|
||||||
var/mobs = getmobs()
|
if(!M || !istype(M))
|
||||||
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in mobs
|
var/mobs = getmobs()
|
||||||
var/mob/M = mobs[selection]
|
var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in mobs
|
||||||
if(!istype(M))
|
M = mobs[selection]
|
||||||
return
|
if(!istype(M))
|
||||||
|
return
|
||||||
var/mob/A = src.mob
|
var/mob/A = src.mob
|
||||||
var/turf/T = get_turf(A)
|
var/turf/T = get_turf(A)
|
||||||
if(T && isturf(T))
|
if(T && isturf(T))
|
||||||
|
|||||||
@@ -107,16 +107,9 @@
|
|||||||
break
|
break
|
||||||
else
|
else
|
||||||
C.images += image(tempHud,perp,"hudunknown")
|
C.images += image(tempHud,perp,"hudunknown")
|
||||||
if(hasorgans(perp))
|
for(var/named in perp.organs)
|
||||||
for(var/datum/organ/external/E in perp)
|
var/datum/organ/external/E = perp.organs[named]
|
||||||
for(var/obj/item/weapon/implant/I in E.implant)
|
for(var/obj/item/weapon/implant/I in E.implant)
|
||||||
if(I.implanted)
|
|
||||||
if(istype(I,/obj/item/weapon/implant/tracking))
|
|
||||||
C.images += image(tempHud,perp,"hud_imp_tracking")
|
|
||||||
if(istype(I,/obj/item/weapon/implant/loyalty))
|
|
||||||
C.images += image(tempHud,perp,"hud_imp_loyal")
|
|
||||||
else
|
|
||||||
for(var/obj/item/weapon/implant/I in perp)
|
|
||||||
if(I.implanted)
|
if(I.implanted)
|
||||||
if(istype(I,/obj/item/weapon/implant/tracking))
|
if(istype(I,/obj/item/weapon/implant/tracking))
|
||||||
C.images += image(tempHud,perp,"hud_imp_tracking")
|
C.images += image(tempHud,perp,"hud_imp_tracking")
|
||||||
|
|||||||
@@ -999,7 +999,7 @@
|
|||||||
var/blood_max = 0
|
var/blood_max = 0
|
||||||
for(var/name in organs)
|
for(var/name in organs)
|
||||||
var/datum/organ/external/temp = organs[name]
|
var/datum/organ/external/temp = organs[name]
|
||||||
if(!temp.bleeding)
|
if(!temp.bleeding || temp.robot) //THAT WAS DUMB.
|
||||||
continue
|
continue
|
||||||
// else
|
// else
|
||||||
// if(prob(35))
|
// if(prob(35))
|
||||||
|
|||||||
@@ -1021,3 +1021,29 @@
|
|||||||
parts -= picked
|
parts -= picked
|
||||||
updatehealth()
|
updatehealth()
|
||||||
UpdateDamageIcon()
|
UpdateDamageIcon()
|
||||||
|
|
||||||
|
/mob/living/carbon/monkey/getBruteLoss()
|
||||||
|
var/amount = 0.0
|
||||||
|
for(var/name in organs)
|
||||||
|
var/datum/organ/external/O = organs[name]
|
||||||
|
if(!O.robot) amount+= O.brute_dam
|
||||||
|
return amount
|
||||||
|
|
||||||
|
/mob/living/carbon/monkey/adjustBruteLoss(var/amount, var/used_weapon = null)
|
||||||
|
if(amount > 0)
|
||||||
|
take_overall_damage(amount, 0, used_weapon)
|
||||||
|
else
|
||||||
|
heal_overall_damage(-amount, 0)
|
||||||
|
|
||||||
|
/mob/living/carbon/monkey/getFireLoss()
|
||||||
|
var/amount = 0.0
|
||||||
|
for(var/name in organs)
|
||||||
|
var/datum/organ/external/O = organs[name]
|
||||||
|
if(!O.robot) amount+= O.burn_dam
|
||||||
|
return amount
|
||||||
|
|
||||||
|
/mob/living/carbon/monkey/adjustFireLoss(var/amount,var/used_weapon = null)
|
||||||
|
if(amount > 0)
|
||||||
|
take_overall_damage(0, amount, used_weapon)
|
||||||
|
else
|
||||||
|
heal_overall_damage(0, -amount)
|
||||||
@@ -95,6 +95,13 @@
|
|||||||
L |= E:contents
|
L |= E:contents
|
||||||
for(var/obj/item/smallDelivery/S in L)
|
for(var/obj/item/smallDelivery/S in L)
|
||||||
L |= S.wrapped
|
L |= S.wrapped
|
||||||
|
if(hasorgans(src))
|
||||||
|
for(var/named in src:organs)
|
||||||
|
var/datum/organ/external/O = src:organs[named]
|
||||||
|
for(var/obj/item/weapon/implant/I in O.implant)
|
||||||
|
L |= I
|
||||||
|
if(istype(I, /obj/item/weapon/implant/compressed))
|
||||||
|
L |= I:scanned
|
||||||
|
|
||||||
for(var/obj/B in L)
|
for(var/obj/B in L)
|
||||||
if(B.type == A)
|
if(B.type == A)
|
||||||
@@ -114,6 +121,13 @@
|
|||||||
L |= E:contents
|
L |= E:contents
|
||||||
for(var/obj/item/smallDelivery/S in L)
|
for(var/obj/item/smallDelivery/S in L)
|
||||||
L |= S.wrapped
|
L |= S.wrapped
|
||||||
|
if(hasorgans(src))
|
||||||
|
for(var/named in src:organs)
|
||||||
|
var/datum/organ/external/O = src:organs[named]
|
||||||
|
for(var/obj/item/weapon/implant/I in O.implant)
|
||||||
|
L |= I
|
||||||
|
if(istype(I, /obj/item/weapon/implant/compressed))
|
||||||
|
L |= I:scanned
|
||||||
|
|
||||||
for(var/obj/item/weapon/reagent_containers/B in L)
|
for(var/obj/item/weapon/reagent_containers/B in L)
|
||||||
for(var/datum/reagent/R in B.reagents.reagent_list)
|
for(var/datum/reagent/R in B.reagents.reagent_list)
|
||||||
|
|||||||
@@ -339,7 +339,7 @@
|
|||||||
for(var/mob/M in listening)
|
for(var/mob/M in listening)
|
||||||
eavesdroppers.Remove(M)
|
eavesdroppers.Remove(M)
|
||||||
for(var/mob/M in eavesdroppers)
|
for(var/mob/M in eavesdroppers)
|
||||||
if(M.stat || !M.client)
|
if(M.stat || !M.client || istype(M, /mob/living/silicon/pai) || M == src)
|
||||||
eavesdroppers.Remove(M)
|
eavesdroppers.Remove(M)
|
||||||
|
|
||||||
for (var/obj/O in ((W | contents)-used_radios))
|
for (var/obj/O in ((W | contents)-used_radios))
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
if (length(message) >= 2)
|
if (length(message) >= 2)
|
||||||
if ((copytext(message, 1, 3) == ":s") || (copytext(message, 1, 3) == ":S"))
|
if ((copytext(message, 1, 3) == ":s") || (copytext(message, 1, 3) == ":S"))
|
||||||
if(istype(src, /mob/living/silicon/pai))
|
// if(istype(src, /mob/living/silicon/pai))
|
||||||
return ..(message)
|
// return ..(message)
|
||||||
message = copytext(message, 3)
|
message = copytext(message, 3)
|
||||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||||
robot_talk(message)
|
robot_talk(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user