Part one of bugfixes for the new damage system.

This commit is contained in:
SkyMarshal
2012-03-30 20:31:26 -07:00
parent cae82368d1
commit a90173c628
13 changed files with 260 additions and 92 deletions

View File

@@ -329,8 +329,10 @@
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
head.screen_loc = ui_head
else
var/datum/organ/external/head = organs["head"]
if(!head.destroyed)
//if not wearing anything on the head, show the ears
overlays += image("icon" = icon('tajaran.dmi', "ears_[gender==FEMALE ? "f" : "m"]_[lying ? "l" : "s"]"), "layer" = MOB_LAYER)
overlays += image("icon" = icon('tajaran.dmi', "ears_[gender==FEMALE ? "f" : "m"]_[lying ? "l" : "s"]"), "layer" = MOB_LAYER)
// Belt
if (belt)
@@ -474,8 +476,8 @@
else if (gender == FEMALE)
g = "f"
stand_icon = new /icon('tajaran.dmi', "torso_s")
lying_icon = new /icon('tajaran.dmi', "torso_l")
stand_icon = new /icon('tajaran.dmi', "torso_[g]_s")
lying_icon = new /icon('tajaran.dmi', "torso_[g]_l")
var/husk = (mutations & HUSK)
//var/obese = (mutations & FAT)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -643,7 +643,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
total = rand(1, total)
for (item in L)
total -=L [item]
total -= L[item]
if (total <= 0)
return item

View File

@@ -3,7 +3,8 @@
for(var/o in typesof(/datum/objective/steal))
if(o != /datum/objective/steal) //Make sure not to get a blank steal objective.
objectives += new o(null,job)
var/datum/objective/target = new o(null,job)
objectives += list(target = target.weight)
//objectives += GenerateAssassinate(job,traitor)
return objectives
@@ -14,7 +15,8 @@
for(var/datum/mind/target in ticker.minds)
if((target != traitor) && istype(target.current, /mob/living/carbon/human))
if(target && target.current)
missions += new /datum/objective/assassinate(null,job,target)
var/datum/objective/target_obj = new /datum/objective/assassinate(null,job,target)
missions += list(target_obj = target_obj.weight)
return missions
/proc/GenerateFrame(var/job,var/datum/mind/traitor)
@@ -23,7 +25,8 @@
for(var/datum/mind/target in ticker.minds)
if((target != traitor) && istype(target.current, /mob/living/carbon/human))
if(target && target.current)
missions += new /datum/objective/frame(null,job,target)
var/datum/objective/target_obj = new /datum/objective/frame(null,job,target)
missions += list(target_obj = target_obj.weight)
return missions
/proc/GenerateProtection(var/job,var/datum/mind/traitor)
@@ -32,7 +35,8 @@
for(var/datum/mind/target in ticker.minds)
if((target != traitor) && istype(target.current, /mob/living/carbon/human))
if(target && target.current)
missions += new /datum/objective/protection(null,job,target)
var/datum/objective/target_obj = new /datum/objective/protection(null,job,target)
missions += list(target_obj = target_obj.weight)
return missions
@@ -51,26 +55,26 @@
while(totalweight < 100)
selectobj = rand(1,100) //Randomly determine the type of objective to be given.
if(!length(killobjectives) || !length(protectobjectives)) //If any of these lists are empty, just give them theft objectives.
var/datum/objective/objective = pick(theftobjectives)
var/datum/objective/objective = pickweight(theftobjectives)
chosenobjectives += objective
totalweight += objective.weight
totalweight += objective.points
theftobjectives -= objective
else switch(selectobj)
if(1 to 55) //Theft Objectives (55% chance)
var/datum/objective/objective = pick(theftobjectives)
var/datum/objective/objective = pickweight(theftobjectives)
for(1 to 10)
if(objective.weight + totalweight <= 110)
if(objective.points + totalweight <= 110)
break
objective = pick(theftobjectives)
objective = pickweight(theftobjectives)
chosenobjectives += objective
totalweight += objective.weight
totalweight += objective.points
theftobjectives -= objective
if(56 to 92) //Assassination Objectives (37% chance)
var/datum/objective/assassinate/objective = pick(killobjectives)
var/datum/objective/assassinate/objective = pickweight(killobjectives)
for(1 to 10)
if(objective.weight + totalweight <= 110)
if(objective.points + totalweight <= 110)
break
objective = pick(killobjectives)
objective = pickweight(killobjectives)
for(var/datum/objective/protection/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Assassinate somebody they need to Protect.
if(conflicttest.target == objective.target)
conflict = 1
@@ -81,24 +85,24 @@
break
if(!conflict)
chosenobjectives += objective
totalweight += objective.weight
totalweight += objective.points
killobjectives -= objective
conflict = 0
if(93 to 95) //Framing Objectives (3% chance)
var/datum/objective/objective = pick(frameobjectives)
var/datum/objective/objective = pickweight(frameobjectives)
for(1 to 10)
if(objective.weight + totalweight <= 110)
if(objective.points + totalweight <= 110)
break
objective = pick(frameobjectives)
objective = pickweight(frameobjectives)
chosenobjectives += objective
totalweight += objective.weight
totalweight += objective.points
frameobjectives -= objective
if(96 to 100) //Protection Objectives (5% chance)
var/datum/objective/protection/objective = pick(protectobjectives)
var/datum/objective/protection/objective = pickweight(protectobjectives)
for(1 to 10)
if(objective.weight + totalweight <= 110)
if(objective.points + totalweight <= 110)
break
objective = pick(protectobjectives)
objective = pickweight(protectobjectives)
for(var/datum/objective/assassinate/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate.
if(conflicttest.target == objective.target)
conflict = 1
@@ -109,7 +113,7 @@
break
if(!conflict)
chosenobjectives += objective
totalweight += objective.weight
totalweight += objective.points
protectobjectives -= objective
conflict = 0
@@ -134,19 +138,22 @@ datum
var/datum/mind/target
var/explanation_text = "text not set"
var/job
// var/points = INFINITY //If this isn't set to something else, the objective is bugged and should be ignored
var/points = INFINITY //If this isn't set to something else, the objective is bugged and should be ignored
var/weight = INFINITY
New(var/text,var/joba)
if(text)
src.explanation_text = text
job=joba
weight = get_points(job)
weight = get_weight(job)
points = get_points(job)
proc/check_completion()
return 1
proc/get_points(var/job)
return INFINITY
proc/get_weight(var/job)
return INFINITY
proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned.
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) )
@@ -179,20 +186,26 @@ datum
get_points()
if(target)
var/difficulty = GetRank(target.assigned_role) + 1
switch(GetRank(job))
if(4)
return 30
return 20*difficulty
if(3)
return 40
return 30*difficulty
if(2)
return 50
return 40*difficulty
if(1)
return 55
return 55*difficulty
if(0)
return 60
return 60*difficulty
else
return INFINITY
get_weight()
if(target)
return 1
return 0
protection
New(var/text,var/joba,var/datum/mind/targeta)
@@ -218,7 +231,15 @@ datum
return 0
get_points()
return 30
if(target)
return 30
else
return INFINITY
get_weight()
if(target)
return 1
return 0
find_target_by_role(role, role_type=0)
..(role, role_type)
@@ -247,20 +268,26 @@ datum
return 1
get_points()
if(target)
var/difficulty = GetRank(target.assigned_role) + 1
switch(GetRank(job))
if(4)
return 30
return 20*difficulty
if(3)
return 40
return 30*difficulty
if(2)
return 50
return 40*difficulty
if(1)
return 55
return 55*difficulty
if(0)
return 60
return 60*difficulty
else
return 0
get_weight()
if(target)
return 1
return 0
find_target_by_role(var/role)
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role))
@@ -327,19 +354,25 @@ datum
get_points()
if(target)
switch(GetRank(owner.assigned_role))
var/difficulty = GetRank(target.assigned_role) + 1
switch(GetRank(job))
if(4)
return 30
return 20*difficulty
if(3)
return 40
return 30*difficulty
if(2)
return 50
return 40*difficulty
if(1)
return 55
return 55*difficulty
if(0)
return 60
return 60*difficulty
else
return 0
return INFINITY
get_weight()
if(target)
return 1
return 0
hijack
@@ -374,6 +407,8 @@ datum
if(4)
return 35
get_weight(var/job)
return 1
escape
explanation_text = "Escape on the shuttle alive, without being arrested."
@@ -399,6 +434,9 @@ datum
get_points()
return INFINITY
get_weight(var/job)
return 1
survive
explanation_text = "Stay alive."
@@ -411,6 +449,9 @@ datum
get_points()
return INFINITY
get_weight(var/job)
return 1
steal
var/obj/item/steal_target
@@ -441,6 +482,12 @@ datum
if(4)
return 20
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
plasmatank
steal_target = /obj/item/weapon/tank/plasma
@@ -452,6 +499,16 @@ datum
return 20
return 40
get_weight(var/job)
return 20
check_completion()
var/list/all_items = owner.current.get_contents()
for(var/obj/item/I in all_items)
if(!istype(I, steal_target)) continue//If it's not actually that item.
if(I:air_contents:toxins) return 1 //If they got one with plasma
return 0
/*Removing this as an objective. Not necessary to have two theft objectives in the same room.
steal/captainssuit
@@ -492,6 +549,12 @@ datum
if(4)
return 20
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
RCD
steal_target = /obj/item/weapon/rcd
@@ -511,6 +574,12 @@ datum
if(4)
return 20
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
/*burger
steal_target = /obj/item/weapon/reagent_containers/food/snacks/human/burger
@@ -549,6 +618,12 @@ datum
if(4)
return 20
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
magboots
steal_target = /obj/item/clothing/shoes/magboots
@@ -568,6 +643,12 @@ datum
if(4)
return 20
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
blueprints
steal_target = /obj/item/blueprints
@@ -587,6 +668,12 @@ datum
if(4)
return 20
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
voidsuit
steal_target = /obj/item/clothing/suit/space/nasavoid
@@ -606,6 +693,9 @@ datum
if(4)
return 20
get_weight(var/job)
return 20
nuke_disk
steal_target = /obj/item/weapon/disk/nuclear
@@ -625,6 +715,12 @@ datum
if(4)
return 25
get_weight(var/job)
if(GetRank(job) == 4)
return 10
else
return 20
nuke_gun
steal_target = /obj/item/weapon/gun/energy/gun/nuclear
explanation_text = "Steal a nuclear powered gun."
@@ -643,6 +739,9 @@ datum
if(4)
return 75
get_weight(var/job)
return 2
diamond_drill
steal_target = /obj/item/weapon/pickaxe/diamonddrill
explanation_text = "Steal a diamond drill."
@@ -661,6 +760,9 @@ datum
if(4)
return 75
get_weight(var/job)
return 2
boh
steal_target = /obj/item/weapon/storage/backpack/holding
explanation_text = "Steal a \"bag of holding.\""
@@ -679,6 +781,9 @@ datum
if(4)
return 75
get_weight(var/job)
return 2
hyper_cell
steal_target = /obj/item/weapon/cell/hyper
explanation_text = "Steal a hyper capacity power cell."
@@ -697,6 +802,9 @@ datum
if(4)
return 75
get_weight(var/job)
return 2
lucy
steal_target = /obj/item/stack/sheet/diamond
explanation_text = "Steal 10 diamonds."
@@ -715,6 +823,9 @@ datum
if(4)
return 75
get_weight(var/job)
return 2
check_completion()
var/target_amount = 10
var/found_amount = 0.0//Always starts as zero.
@@ -741,6 +852,9 @@ datum
if(4)
return 70
get_weight(var/job)
return 2
check_completion()
var/target_amount = 50
var/found_amount = 0.0//Always starts as zero.
@@ -767,6 +881,9 @@ datum
if(4)
return 70
get_weight(var/job)
return 2
check_completion()
var/target_amount = 25
var/found_amount = 0.0//Always starts as zero.
@@ -819,6 +936,9 @@ datum
if(istype(objective,/obj/item/robot_parts/robot_suit) && objective.check_completion())
return 1
return 0
get_weight(var/job)
return 20
AI
steal_target = /obj/structure/AIcore
explanation_text = "Steal a finished AI, either by intellicard or stealing the whole construct."
@@ -837,6 +957,9 @@ datum
if(4)
return 20
get_weight(var/job)
return 15
check_completion()
if(steal_target)
for(var/obj/item/device/aicard/C in owner.current.get_contents())
@@ -878,6 +1001,9 @@ datum
else
return 0
get_weight(var/job)
return 20
pacid
steal_target = /datum/reagent/pacid
@@ -904,6 +1030,9 @@ datum
else
return 0
get_weight(var/job)
return 20
reagent
var/target_name
@@ -957,6 +1086,9 @@ datum
else
return 0
get_weight(var/job)
return 20
nuclear
explanation_text = "Destroy the station with a nuclear device."

View File

@@ -38,31 +38,36 @@ MEDICAL
if(!istype(affecting, /datum/organ/external) || affecting:burn_dam <= 0)
affecting = H.get_organ("head")
if(affecting.destroyed && !affecting.gauzed)
H.visible_message("\red You do your best to stop the bleeding from [H]'s stump.", "\red [user] does their best to stem [H]'s bleeding from [H.gender == MALE? "his" : "her"] stump.", "\red You hear something like gauze being ripped.")
user.visible_message("\red You do your best to stop the bleeding from [H]'s stump.", "\red [user] does [user.gender == MALE? "his" : "her"] best to stem [H]'s bleeding from [H.gender == MALE? "his" : "her"] stump.", "\red You hear something like gauze being ripped.")
affecting.gauzed = 1
use(1)
return
for(var/datum/organ/wound/W in affecting.wounds)
if(W.bleeding || !W.healing_state)
if(W.bleeding || !W.is_healing)
if(heal_brute && W.wound_type == 2)
continue
if(heal_burn && W.wound_type < 2)
continue
if(stoppedblood)
stoppedblood++
break
if(W.wound_size > 3)
if(W.wound_size > 3 && (W.bleeding || !W.is_healing))
if(stoppedblood)
stoppedblood += 1
break
W.bleeding = 0
else
W.is_healing = 1
stoppedblood = 1
else if(W.wound_size <= 3)
if(stoppedblood)
stoppedblood += 1
break
W.stopbleeding()
stoppedblood = 1
stoppedblood = 1
if (user && stoppedblood)
if (M != user)
H.visible_message("\red You bandage up [stoppedblood - 1 ? "some of" : "the last of"] [H]'s cuts", "\red [user] bandages [stoppedblood - 1 ? "some of" : "the last of"] [H]'s cuts with [src]", "\red You hear something like gauze being ripped.")
user.visible_message("\red [user] bandages [stoppedblood - 1 ? "some of" : "the last of"] [H]'s cuts with [src]", "\red You bandage up [stoppedblood - 1 ? "some of" : "the last of"] [H]'s cuts", "\red You hear something like gauze being ripped.")
else
H.visible_message("\red You bandage up [stoppedblood - 1 ? "some of" : "the last of"] your cuts", "\red [user] bandages [stoppedblood - 1 ? "some of" : "the last of"] their own cuts with [src]", "\red You hear something like gauze being ripped.")
user.visible_message("\red [user] bandages [stoppedblood - 1 ? "some of" : "the last of"] [user.gender == MALE? "his" : "her"] own cuts with [src]", "\red You bandage up [stoppedblood - 1 ? "some of" : "the last of"] your cuts", "\red You hear something like gauze being ripped.")
else if(user)
user << "\red Nothing to patch up!"
return

View File

@@ -972,6 +972,7 @@
if(T:vessel.get_reagent_amount("blood") < amount)
return
T:vessel.trans_to(src, amount)
on_reagent_change()
else
var/datum/reagent/B = new /datum/reagent/blood
B.holder = src

View File

@@ -21,7 +21,7 @@ mob/living/carbon/verb/give()
if(!I)
return
if(src.r_hand == null)
switch(alert(src,"[usr.name] wants to give you \a [I.name]?",,"Yes","No"))
switch(alert(src,"[usr] wants to give you \a [I]?",,"Yes","No"))
if("Yes")
if(!check_can_reach(usr,src))
usr << "You need to keep in reaching distance."
@@ -50,7 +50,7 @@ mob/living/carbon/verb/give()
if("No")
src.visible_message("[usr.name] tried to hand [I.name] to [src.name] but [src.name] didn't want it.")
else if(src.l_hand == null)
switch(alert(src,"[src.name] wants to give you \a [I.name]?",,"Yes","No"))
switch(alert(src,"[usr] wants to give you \a [I]?",,"Yes","No"))
if("Yes")
if(!check_can_reach(usr,src))
usr << "You need to keep in reaching distance."
@@ -79,4 +79,4 @@ mob/living/carbon/verb/give()
if("No")
src.visible_message("[usr.name] tried to hand [I.name] to [src.name] but [src.name] didn't want it.")
else
usr << "[src.name]\s hands are full."
usr << "[src.name]'s hands are full."

View File

@@ -436,29 +436,39 @@
if(wound_flavor_text["chest"] && !w_uniform && !skipjumpsuit)
msg += wound_flavor_text["chest"]
else if(is_bleeding["chest"])
msg += "<span class='warning'>[src] has blood from under [t_his] clothing!</span>\n"
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
if(wound_flavor_text["left arm"] && !w_uniform && !skipjumpsuit)
msg += wound_flavor_text["left arm"]
else if(is_bleeding["left arm"])
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
if(wound_flavor_text["left hand"] && !gloves && !skipgloves)
msg += wound_flavor_text["left hand"]
else if(is_bleeding["left hand"])
msg += "<span class='warning'>[src] has blood running from under [t_his] gloves!</span>\n"
if(wound_flavor_text["right arm"] && !w_uniform && !skipjumpsuit)
msg += wound_flavor_text["right arm"]
else if(is_bleeding["right arm"])
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
if(wound_flavor_text["right hand"] && !gloves && !skipgloves)
msg += wound_flavor_text["right hand"]
else if(is_bleeding["right hand"])
msg += "<span class='warning'>[src] has blood running from under [t_his] gloves!</span>\n"
if(wound_flavor_text["groin"] && !w_uniform && !skipjumpsuit)
msg += wound_flavor_text["groin"]
else if(is_bleeding["groin"])
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
if(wound_flavor_text["left leg"] && !w_uniform && !skipjumpsuit)
msg += wound_flavor_text["left leg"]
else if(is_bleeding["left leg"])
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
if(wound_flavor_text["left foot"]&& !shoes && !skipshoes)
msg += wound_flavor_text["left foot"]
else if(is_bleeding["left foot"])
msg += "<span class='warning'>[src] has blood running from [t_his] shoes!</span>\n"
if(wound_flavor_text["right leg"] && !w_uniform && !skipjumpsuit)
msg += wound_flavor_text["right leg"]
else if(is_bleeding["right leg"])
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
if(wound_flavor_text["right foot"]&& !shoes && !skipshoes)
msg += wound_flavor_text["right foot"]
else if(is_bleeding["right foot"])

View File

@@ -54,7 +54,6 @@
var/list/body_standing = list()
var/list/body_lying = list()
var/organs2 = list()
var/mutantrace = null

View File

@@ -857,7 +857,7 @@
leg_tally-- // let it fail even if just foot&leg
// can't stand
if(leg_tally == 0)
if(leg_tally == 0 && !paralysis)
emote("scream")
emote("collapse")
paralysis = 10
@@ -1470,4 +1470,4 @@ snippets
plcheck = t_plasma
oxcheck = t_oxygen
G.turf_add(T, G.total_moles())
*/
*/

View File

@@ -24,26 +24,37 @@
real_name = name
var/datum/organ/external/chest/chest = new /datum/organ/external/chest( src )
chest.owner = src
organs2 += chest
var/datum/organ/external/groin/groin = new /datum/organ/external/groin( src )
groin.owner = src
organs2 += groin
var/datum/organ/external/head/head = new /datum/organ/external/head( src )
head.owner = src
organs2 += head
var/datum/organ/external/l_arm/l_arm = new /datum/organ/external/l_arm( src )
l_arm.owner = src
organs2 += l_arm
var/datum/organ/external/r_arm/r_arm = new /datum/organ/external/r_arm( src )
r_arm.owner = src
organs2 += r_arm
var/datum/organ/external/l_hand/l_hand = new /datum/organ/external/l_hand( src )
l_hand.owner = src
organs2 += l_hand
var/datum/organ/external/r_hand/r_hand = new /datum/organ/external/r_hand( src )
r_hand.owner = src
organs2 += r_hand
var/datum/organ/external/l_leg/l_leg = new /datum/organ/external/l_leg( src )
l_leg.owner = src
organs2 += l_leg
var/datum/organ/external/r_leg/r_leg = new /datum/organ/external/r_leg( src )
r_leg.owner = src
organs2 += r_leg
var/datum/organ/external/l_foot/l_foot = new /datum/organ/external/l_foot( src )
l_foot.owner = src
organs2 += l_foot
var/datum/organ/external/r_foot/r_foot = new /datum/organ/external/r_foot( src )
r_foot.owner = src
organs2 += r_foot
organs["chest"] = chest
organs["groin"] = groin

View File

@@ -280,6 +280,7 @@ the mob is also allowed to move without any sort of restriction. For instance, i
// var/obj/effect/organstructure/organStructure = null //for dem organs
var/list/organs = list( ) //List of organs.
var/list/organs2 = list()
//Singularity wants you!
var/grav_delay = 0

View File

@@ -99,7 +99,7 @@
if(prob(brute) && brute > 20 && !sharp)
createwound(rand(4,6),0,brute)
else if(!sharp)
createwound(max(1,min(6,round(brute/10) + rand(-1,1))),1,brute)
createwound(max(1,min(6,round(brute/10) + rand(0,2))),1,brute)
if(burn)
burn_dam += burn
createwound(max(1,min(6,round(burn/10) + rand(-1,1))),2,burn)
@@ -152,15 +152,16 @@
brute -= W.damage
W.damage = 0
W.initial_dmg = 0
W.stopbleeding()
W.stopbleeding(1)
else
W.damage -= brute
W.initial_dmg -= brute
W.stopbleeding()
else if(brute)
for(var/datum/organ/wound/W in brute_wounds)
W.damage = 0
W.initial_dmg = 0
W.stopbleeding()
W.stopbleeding(1)
brute_dam = 0
if(burn && burn >= burn_to_heal)
for(var/datum/organ/wound/W in burn_wounds)
@@ -173,6 +174,7 @@
else
W.damage -= burn
W.initial_dmg -= burn
W.stopbleeding()
else if(burn)
for(var/datum/organ/wound/W in burn_wounds)
W.damage = 0
@@ -226,8 +228,6 @@
return
if(brute_dam > min_broken_damage)
if(broken == 0)
var/dmgmsg = "[damage_msg] in your [display_name]"
owner << dmgmsg
//owner.unlock_medal("Broke Yarrr Bones!", 0, "Break a bone.", "easy")
owner.visible_message("\red You hear a loud cracking sound coming from [owner.name].","\red <b>Something feels like it shattered in your [display_name]!</b>","You hear a sickening crack.")
owner.emote("scream")
@@ -275,6 +275,8 @@
proc/droplimb()
if(destroyed)
//owner.unlock_medal("Lost something?", 0, "Lose a limb.", "easy")
owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.","\red <b>Your [display_name] goes flying off!</b>","You hear a terrible sound of ripping tendons and flesh.")
switch(body_part)
if(UPPER_TORSO)
owner.gib()
@@ -288,6 +290,7 @@
H.transfer_identity(owner)
H.pixel_x = -10
H.pixel_y = 6
H.name = "[owner.name]'s head"
var/lol = pick(cardinal)
step(H,lol)
@@ -332,29 +335,21 @@
destroyed = 1
if(HAND_RIGHT)
var/obj/item/weapon/organ/r_hand/X = new(owner.loc, owner)
for(var/mob/M in viewers(owner))
M.show_message("\red [owner.name]'s [X.name] flies off in an arc.")
var/lol2 = pick(cardinal)
step(X,lol2)
destroyed = 1
if(HAND_LEFT)
var/obj/item/weapon/organ/l_hand/X = new(owner.loc, owner)
for(var/mob/M in viewers(owner))
M.show_message("\red [owner.name]'s [X.name] flies off in an arc.")
var/lol2 = pick(cardinal)
step(X,lol2)
destroyed = 1
if(FOOT_RIGHT)
var/obj/item/weapon/organ/r_foot/X = new(owner.loc, owner)
for(var/mob/M in viewers(owner))
M.show_message("\red [owner.name]'s [X.name] flies off in an arc.")
var/lol2 = pick(cardinal)
step(X,lol2)
destroyed = 1
if(FOOT_LEFT)
var/obj/item/weapon/organ/l_foot/X = new(owner.loc, owner)
for(var/mob/M in viewers(owner))
M.show_message("\red [owner.name]'s [X.name] flies off in an arc.")
var/lol2 = pick(cardinal)
step(X,lol2)
destroyed = 1
@@ -377,7 +372,10 @@
W.wound_size = size
W.owner = owner
W.parent = src
spawn W.start_close() //Let small cuts close themselves.
if(type == 1)
spawn W.become_scar()
else
spawn W.start_close() //Let small cuts close themselves.
wounds += W
/datum/organ/wound
@@ -389,6 +387,8 @@
var/datum/organ/external/parent
var/bleeding = 0 //You got wounded, of course it's bleeding. -- Scratch that. Rewrote it.
var/healing_state = 0
var/is_healing = 0
var/slowheal = 3
proc/start_close()
sleep(rand(1800,3000)) //3-5 minutes
@@ -400,7 +400,7 @@
stopbleeding()
return
sleep(rand(1800,3000))
if(wound_size == 1) //Small cuts heal in 3-10 minutes.
if(wound_size == 1) //Small cuts heal in 6-10 minutes.
parent.wounds.Remove(src)
update_health(1)
del(src)
@@ -408,30 +408,34 @@
stopbleeding()
return
if(wound_size < 5 && bleeding) //Give it a chance to stop bleeding on it's own.
spawn(1)
spawn while(1)
sleep(1200)
if(prob(50))
stopbleeding()
return
return
proc/stopbleeding()
if(healing_state)
proc/stopbleeding(var/bleed = 0)
if(is_healing)
return 0
// owner:bloodloss -= 10 * src.wound_size
parent.bleeding = 0
parent.bleeding = min(bleed,bleeding)
for(var/datum/organ/wound/W in parent)
if(W.bleeding && W != src)
parent.bleeding = 1
bleeding = 0
break
bleeding = min(bleed,bleeding)
is_healing = 1
slowheal = 1
spawn become_scar() //spawn off the process of becoming a scar.
return 1
proc/become_scar()
healing_state = 1 //Patched
update_health(0.5) //Heals some.
spawn(200) //20 seconds
update_health(5) //Heals some.
sleep(rand(1800,3000)) //3-5 minutes
sleep(rand(1800,3000)*slowheal) //3-5 minutes
if(parent.owner.stat == 2)
return
@@ -441,23 +445,26 @@
del(src)
healing_state = 2 //Noticibly healing.
update_health(1) //Heals the rest of the way.
update_health(2) //Heals more.
sleep(rand(1800,3000)) //3-5 minutes
sleep(rand(1800,3000)*slowheal) //3-5 minutes
if(parent.owner.stat == 2)
return
if(prob(60) && wound_size < 3) //Cuts heal up
parent.wounds.Remove(src)
del(src)
healing_state = 3 //Angry red scar
sleep(rand(6000,9000)) //10-15 minutes
update_health(1) //Heals the rest of the way.
sleep(rand(6000,9000)*slowheal) //10-15 minutes
if(parent.owner.stat == 2)
return
if(prob(80) && wound_size < 4) //Minor wounds heal up fully.
parent.wounds.Remove(src)
del(src)
healing_state = 4 //Scar
sleep(rand(6000,9000)) //10-15 minutes
sleep(rand(6000,9000)*slowheal) //10-15 minutes
if(parent.owner.stat == 2)
return
if(prob(30) || wound_size < 4 || wound_type == 1) //Small chance for the scar to disappear, any small remaining wounds deleted.
@@ -467,11 +474,11 @@
return
proc/update_health(var/percent = 1)
damage -= damage/percent //Remove that amount of the damage
damage = max(damage - damage/percent,0) //Remove that amount of the damage
if(wound_type > 1)
parent.burn_dam -= initial_dmg - damage
parent.burn_dam = max(parent.burn_dam - (initial_dmg - damage),0)
else
parent.brute_dam -= initial_dmg - damage
parent.brute_dam = max(parent.brute_dam - (initial_dmg - damage),0)
initial_dmg = damage //reset it for further updates.
parent.owner.updatehealth()