Merge branch 'master' into upstream-merge-9307

This commit is contained in:
cadyn
2020-11-15 00:48:22 -08:00
committed by GitHub
149 changed files with 17211 additions and 466 deletions
+66
View File
@@ -0,0 +1,66 @@
/mob/living
var/meat_amount = 0 // How much meat to drop from this mob when butchered
var/obj/meat_type // The meat object to drop
var/gib_on_butchery = FALSE
var/list/butchery_loot // Associated list, path = number.
// Harvest an animal's delicious byproducts
/mob/living/proc/harvest(var/mob/user, var/obj/item/I)
if(meat_type && meat_amount>0 && (stat == DEAD))
while(meat_amount > 0 && do_after(user, 0.5 SECONDS * (mob_size / 10), src))
var/obj/item/meat = new meat_type(get_turf(src))
meat.name = "[src.name] [meat.name]"
new /obj/effect/decal/cleanable/blood/splatter(get_turf(src))
meat_amount--
if(!meat_amount)
handle_butcher(user, I)
/mob/living/proc/can_butcher(var/mob/user, var/obj/item/I) // Override for special butchering checks.
if(((meat_type && meat_amount) || LAZYLEN(butchery_loot)) && stat == DEAD)
return TRUE
return FALSE
/mob/living/proc/handle_butcher(var/mob/user, var/obj/item/I)
if(!user || do_after(user, 2 SECONDS * mob_size / 10, src))
if(LAZYLEN(butchery_loot))
if(LAZYLEN(butchery_loot))
for(var/path in butchery_loot)
while(butchery_loot[path])
butchery_loot[path] -= 1
var/obj/item/loot = new path(get_turf(src))
loot.pixel_x = rand(-12, 12)
loot.pixel_y = rand(-12, 12)
butchery_loot.Cut()
butchery_loot = null
if(LAZYLEN(organs))
organs_by_name.Cut()
for(var/obj/item/organ/OR in organs)
OR.removed()
organs -= OR
if(LAZYLEN(internal_organs))
internal_organs_by_name.Cut()
for(var/obj/item/organ/OR in internal_organs)
OR.removed()
internal_organs -= OR
if(!ckey)
if(issmall(src))
user?.visible_message("<span class='danger'>[user] chops up \the [src]!</span>")
new /obj/effect/decal/cleanable/blood/splatter(get_turf(src))
if(gib_on_butchery)
qdel(src)
else
user?.visible_message("<span class='danger'>[user] butchers \the [src] messily!</span>")
if(gib_on_butchery)
gib()
@@ -1,4 +1,4 @@
/mob/living/carbon/
/mob/living/carbon
gender = MALE
var/datum/species/species //Contains icon generation and language information, set during New().
var/list/stomach_contents = list()
@@ -177,7 +177,7 @@
message = "makes a weird noise!"
playsound(src.loc, 'sound/misc/ough.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises)
m_type = 2 //End of Yawn Addtion
*/
*/
if ("howl") // YW add begins
m_type = 2
message = "lets out a howl."
@@ -269,7 +269,7 @@
set desc = "Switch tail layer on top."
tail_alt = !tail_alt
update_tail_showing()
/mob/living/carbon/human/verb/hide_wings_vr()
set name = "Show/Hide wings"
set category = "IC"
@@ -282,4 +282,12 @@
else
message = "hides their wings."
visible_message("[src] [message]")
// Chomp Edit Start
/mob/living/carbon/human/verb/hide_nutrition_vr()
set name = "Show/Hide Nutrition Levels"
set category = "IC"
set desc = "Allow other player to see your current nutrition level or not."
nutrition_hidden = !nutrition_hidden
to_chat(src, "Players will [nutrition_hidden ? "no longer" : "now"] see your nutrition levels.")
// Chomp Edit End
@@ -68,6 +68,8 @@
/mob/living/carbon/human/proc/examine_nutrition()
if(!show_pudge()) //Some clothing or equipment can hide this.
return ""
if(nutrition_hidden) // Chomp Edit
return ""
var/message = ""
var/nutrition_examine = round(nutrition)
var/t_He = "It" //capitalised for use at the start of each line.
@@ -1,3 +1,6 @@
/mob/living/carbon/human
var/datum/unarmed_attack/default_attack
/mob/living/carbon/human/proc/get_unarmed_attack(var/mob/living/carbon/human/target, var/hit_zone)
// VOREStation Edit - Begin
if(nif && nif.flag_check(NIF_C_HARDCLAWS,NIF_FLAGS_COMBAT)){return unarmed_hardclaws}
@@ -16,6 +19,12 @@
if(soft_type)
return soft_type
return G.special_attack
if(src.default_attack && src.default_attack.is_usable(src, target, hit_zone))
if(pulling_punches)
var/datum/unarmed_attack/soft_type = src.default_attack.get_sparring_variant()
if(soft_type)
return soft_type
return src.default_attack
for(var/datum/unarmed_attack/u_attack in species.unarmed_attacks)
if(u_attack.is_usable(src, target, hit_zone))
if(pulling_punches)
@@ -434,3 +443,37 @@
user.visible_message("\The [user] stops applying pressure to [src]'s [organ.name]!", "You stop applying pressure to [src]'s [organ.name]!")
return TRUE
/mob/living/carbon/human/verb/check_attacks()
set name = "Check Attacks"
set category = "IC"
set src = usr
var/dat = "<b><font size = 5>Known Attacks</font></b><br/><br/>"
if(default_attack)
dat += "Current default attack: [default_attack.attack_name] - <a href='byond://?src=\ref[src];default_attk=reset_attk'>reset</a><br/><br/>"
for(var/datum/unarmed_attack/u_attack in species.unarmed_attacks)
if(u_attack == default_attack)
dat += "<b>Primarily [u_attack.attack_name]</b> - default - <a href='byond://?src=\ref[src];default_attk=reset_attk'>reset</a><br/><br/><br/>"
else
dat += "<b>Primarily [u_attack.attack_name]</b> - <a href='byond://?src=\ref[src];default_attk=\ref[u_attack]'>set default</a><br/><br/><br/>"
src << browse(dat, "window=checkattack")
/mob/living/carbon/human/Topic(href, href_list)
if(href_list["default_attk"])
if(href_list["default_attk"] == "reset_attk")
set_default_attack(null)
else
var/datum/unarmed_attack/u_attack = locate(href_list["default_attk"])
if(u_attack && (u_attack in species.unarmed_attacks))
set_default_attack(u_attack)
check_attacks()
return 1
else
return ..()
/mob/living/carbon/human/proc/set_default_attack(var/datum/unarmed_attack/u_attack)
default_attack = u_attack
@@ -288,7 +288,7 @@
oxyloss = 0
else
..()
/mob/living/carbon/human/adjustHalLoss(var/amount)
if(species.flags & NO_PAIN)
halloss = 0
@@ -439,13 +439,14 @@ This function restores all organs.
return 0
return
/*
/mob/living/carbon/human/proc/get_organ(var/zone)
if(!zone)
zone = BP_TORSO
else if (zone in list( O_EYES, O_MOUTH ))
zone = BP_HEAD
return organs_by_name[zone]
*/
/mob/living/carbon/human/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/soaked = 0, var/sharp = 0, var/edge = 0, var/obj/used_weapon = null)
if(Debug2)
@@ -44,7 +44,7 @@
var/age = 30 //Player's age (pure fluff)
var/b_type = "A+" //Player's bloodtype
var/datum/robolimb/synthetic //If they are a synthetic (aka synthetic torso)
var/datum/robolimb/synthetic //If they are a synthetic (aka synthetic torso). Also holds the datum for the type of robolimb.
var/list/all_underwear = list()
var/list/all_underwear_metadata = list()
@@ -85,7 +85,6 @@
var/special_voice = "" // For changing our voice. Used by a symptom.
var/last_dam = -1 //Used for determining if we need to process all organs or just some or even none.
var/list/bad_external_organs = list()// organs we check until they are good.
var/xylophone = 0 //For the spoooooooky xylophone cooldown
@@ -118,3 +117,4 @@
var/obj/machinery/machine_visual //machine that is currently applying visual effects to this mob. Only used for camera monitors currently.
inventory_panel_type = /datum/inventory_panel/human
butchery_loot = list(/obj/item/stack/animalhide/human = 1)
@@ -10,6 +10,7 @@
var/ability_flags = 0 //Shadekin abilities/potentially other species-based?
var/sensorpref = 5 //Suit sensor loadout pref
var/wings_hidden = FALSE
var/nutrition_hidden = FALSE // Chomp Edit
/mob/living/carbon/human/proc/shadekin_get_energy()
var/datum/species/shadekin/SK = species
@@ -5,6 +5,7 @@
update_icons_body() //Body handles eyes
update_eyes() //For floating eyes only
/*
/mob/living/carbon/var/list/internal_organs = list()
/mob/living/carbon/human/var/list/organs = list()
/mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs
@@ -13,6 +14,7 @@
/mob/living/carbon/human/proc/get_bodypart_name(var/zone)
var/obj/item/organ/external/E = get_organ(zone)
if(E) . = E.name
*/
/mob/living/carbon/human/proc/recheck_bad_external_organs()
var/damage_this_tick = getToxLoss()
@@ -1,4 +1,5 @@
/datum/unarmed_attack/bite/sharp //eye teeth
attack_name = "sharp bite"
attack_verb = list("bit", "chomped on")
attack_sound = 'sound/weapons/bite.ogg'
shredding = 0
@@ -6,12 +7,14 @@
edge = 1
/datum/unarmed_attack/diona
attack_name = "tendrils"
attack_verb = list("lashed", "bludgeoned")
attack_noun = list("tendril")
eye_attack_text = "a tendril"
eye_attack_text_victim = "a tendril"
/datum/unarmed_attack/claws
attack_name = "claws"
attack_verb = list("scratched", "clawed", "slashed")
attack_noun = list("claws")
eye_attack_text = "claws"
@@ -54,6 +57,7 @@
if(5) user.visible_message("<span class='danger'>[user] tears [T.his] [pick(attack_noun)] [pick("deep into", "into", "across")] [target]'s [affecting.name]!</span>")
/datum/unarmed_attack/claws/strong
attack_name = "strong claws"
attack_verb = list("slashed")
damage = 5
shredding = 1
@@ -67,6 +71,7 @@
damage = 15
/datum/unarmed_attack/bite/strong
attack_name = "strong bite"
attack_verb = list("mauled")
damage = 8
shredding = 1
@@ -75,6 +80,7 @@
damage = 10
/datum/unarmed_attack/slime_glomp
attack_name = "glomp"
attack_verb = list("glomped")
attack_noun = list("body")
damage = 2
@@ -84,6 +90,7 @@
user.apply_stored_shock_to(target)
/datum/unarmed_attack/stomp/weak
attack_name = "weak stomp"
attack_verb = list("jumped on")
/datum/unarmed_attack/stomp/weak/get_unarmed_damage()
@@ -142,8 +142,8 @@
)
unarmed_types = list(
/datum/unarmed_attack/bite/sharp,
/datum/unarmed_attack/claws,
/datum/unarmed_attack/bite/sharp,
/datum/unarmed_attack/stomp/weak
)
@@ -30,11 +30,10 @@
excludes = list(/datum/trait/lonely)
/datum/trait/lonely/proc/check_mob_company(var/mob/living/carbon/human/H,var/mob/living/M)
if(only_people && !istype(M, /mob/living/carbon) && !istype(M, /mob/living/silicon/robot))
return 0
if(M == H || M.stat == DEAD || M.invisibility > H.see_invisible)
return 0
if(only_people && !M.ckey)
var/social_check = only_people && !istype(M, /mob/living/carbon) && !istype(M, /mob/living/silicon/robot)
var/self_dead_invisible_check = M == H || M.stat == DEAD || M.invisibility > H.see_invisible
var/ckey_check = only_people && !M.ckey
if(social_check || self_dead_invisible_check || ckey_check)
return 0
if(M.faction == "neutral" || M.faction == H.faction)
if(H.loneliness_stage > 0)
@@ -71,9 +70,13 @@
H.loneliness_stage -= 4
return
// Check for company.
for(var/mob/living/M in viewers(H))
for(var/mob/living/M in H.contents)
if(istype(M) && check_mob_company(H,M))
return
for(var/mob/living/M in viewers(get_turf(H)))
if(check_mob_company(H,M))
return
//Check to see if there's anyone in our belly
if(H.vore_organs)
for(var/obj/belly/B in H.vore_organs)
for(var/mob/living/content in B.contents)
@@ -34,4 +34,4 @@
desc = "Your body is able to produce nutrition from being in light."
cost = 3
var_changes = list("photosynthesizing" = TRUE)
not_for_synths = 1 //Synths don't use nutrition.
not_for_synths = 0 //Synths actually use nutrition, just with a fancy covering.
@@ -2,6 +2,7 @@ var/global/list/sparring_attack_cache = list()
//Species unarmed attacks
/datum/unarmed_attack
var/attack_name = "fist"
var/attack_verb = list("attack") // Empty hand hurt intent verb.
var/attack_noun = list("fist")
var/damage = 0 // Extra empty hand attack damage.
@@ -109,6 +110,7 @@ var/global/list/sparring_attack_cache = list()
return FALSE //return true if the unarmed override prevents further attacks
/datum/unarmed_attack/bite
attack_name = "bite"
attack_verb = list("bit")
attack_sound = 'sound/weapons/bite.ogg'
shredding = 0
@@ -127,6 +129,7 @@ var/global/list/sparring_attack_cache = list()
return TRUE
/datum/unarmed_attack/punch
attack_name = "punch"
attack_verb = list("punched")
attack_noun = list("fist")
eye_attack_text = "fingers"
@@ -181,6 +184,7 @@ var/global/list/sparring_attack_cache = list()
user.visible_message("<span class='danger'>[user] [pick("punched", "threw a punch against", "struck", "slammed [TU.his] [pick(attack_noun)] into")] [target]'s [organ]!</span>") //why do we have a separate set of verbs for lying targets?
/datum/unarmed_attack/kick
attack_name = "kick"
attack_verb = list("kicked", "kicked", "kicked", "kneed")
attack_noun = list("kick", "kick", "kick", "knee strike")
attack_sound = "swing_hit"
@@ -224,6 +228,7 @@ var/global/list/sparring_attack_cache = list()
if(5) user.visible_message("<span class='danger'>[user] landed a strong [pick(attack_noun)] against [target]'s [organ]!</span>")
/datum/unarmed_attack/stomp
attack_name = "stomp"
attack_verb = null
attack_noun = list("stomp")
attack_sound = "swing_hit"
@@ -269,6 +274,7 @@ var/global/list/sparring_attack_cache = list()
if(5) user.visible_message("<span class='danger'>[pick("[user] landed a powerful stomp on", "[user] stomped down hard on", "[user] slammed [TU.his] [shoes ? copytext(shoes.name, 1, -1) : "foot"] down hard onto")] [target]'s [organ]!</span>") //Devastated lol. No. We want to say that the stomp was powerful or forceful, not that it /wrought devastation/
/datum/unarmed_attack/light_strike
attack_name = "light hit"
attack_noun = list("tap","light strike")
attack_verb = list("tapped", "lightly struck")
damage = 3
+23 -1
View File
@@ -31,9 +31,25 @@
nest = null
if(buckled)
buckled.unbuckle_mob(src, TRUE)
qdel(selected_image)
QDEL_NULL(vorePanel) //VOREStation Add
QDEL_LIST_NULL(vore_organs) //VOREStation Add
if(LAZYLEN(organs))
organs_by_name.Cut()
while(organs.len)
var/obj/item/OR = organs[1]
organs -= OR
qdel(OR)
if(LAZYLEN(internal_organs))
internal_organs_by_name.Cut()
while(internal_organs.len)
var/obj/item/OR = internal_organs[1]
internal_organs -= OR
qdel(OR)
return ..()
//mob verbs are faster than object verbs. See mob/verb/examine.
@@ -924,6 +940,12 @@ default behaviour is:
/mob/living/Moved(var/atom/oldloc, direct, forced, movetime)
. = ..()
handle_footstep(loc)
// Begin VOREstation edit
if(is_shifted)
is_shifted = FALSE
pixel_x = 0
pixel_y = 0
// End VOREstation edit
if(pulling) // we were pulling a thing and didn't lose it during our move.
var/pull_dir = get_dir(src, pulling)
@@ -1462,4 +1484,4 @@ default behaviour is:
// Tries to turn off things that let you see through walls, like mesons.
// Each mob does vision a bit differently so this is just for inheritence and also so overrided procs can make the vision apply instantly if they call `..()`.
/mob/living/proc/disable_spoiler_vision()
handle_vision()
handle_vision()
+1 -1
View File
@@ -74,4 +74,4 @@
var/image/selected_image = null // Used for buildmode AI control stuff.
var/inventory_panel_type = /datum/inventory_panel
var/datum/inventory_panel/inventory_panel
var/datum/inventory_panel/inventory_panel
+28
View File
@@ -0,0 +1,28 @@
/mob/living
var/list/internal_organs = list()
var/list/organs = list()
var/list/organs_by_name = list() // map organ names to organs
var/list/internal_organs_by_name = list() // so internal organs have less ickiness too
var/list/bad_external_organs = list()// organs we check until they are good.
/mob/living/proc/get_bodypart_name(var/zone)
var/obj/item/organ/external/E = get_organ(zone)
if(E) . = E.name
/mob/living/proc/get_organ(var/zone)
if(!zone)
zone = BP_TORSO
else if (zone in list( O_EYES, O_MOUTH ))
zone = BP_HEAD
return organs_by_name[zone]
/mob/living/gib()
for(var/obj/item/organ/I in internal_organs)
I.removed()
if(isturf(I?.loc)) // Some organs qdel themselves or other things when removed
I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30)
for(var/obj/item/organ/external/E in src.organs)
E.droplimb(0,DROPLIMB_EDGE,1)
..()
@@ -145,6 +145,7 @@
name = "MediHound hypospray"
desc = "An advanced chemical synthesizer and injection system utilizing carrier's reserves, designed for heavy-duty medical equipment."
charge_cost = 10
reagent_ids = list("inaprovaline", "dexalin", "bicaridine", "kelotane", "anti_toxin", "spaceacillin", "paracetamol")
var/datum/matter_synth/water = null
/obj/item/weapon/reagent_containers/borghypo/hound/process() //Recharges in smaller steps and uses the water reserves as well.
@@ -39,6 +39,7 @@
var/datum/matter_synth/water = null
var/digest_brute = 2
var/digest_burn = 3
var/digest_multiplier = 1
var/recycles = FALSE
var/medsensor = TRUE //Does belly sprite come with patient ok/dead light?
@@ -541,8 +542,8 @@
else
var/old_brute = T.getBruteLoss()
var/old_burn = T.getFireLoss()
T.adjustBruteLoss(digest_brute)
T.adjustFireLoss(digest_burn)
T.adjustBruteLoss(digest_brute * digest_multiplier)
T.adjustFireLoss(digest_burn * digest_multiplier)
var/actual_brute = T.getBruteLoss() - old_brute
var/actual_burn = T.getFireLoss() - old_burn
var/damage_gain = actual_brute + actual_burn
@@ -717,6 +718,7 @@
icon_state = "sleeperc"
injection_chems = list("glucose","inaprovaline","tricordrazine")
max_item_count = 1
/obj/item/device/dogborg/sleeper/command //Command borg belly // CH addition
name = "Bluespace Filing Belly"
desc = "A mounted bluespace storage unit for carrying paperwork"
@@ -726,4 +728,4 @@
recycles = FALSE
max_item_count = 25
#undef SLEEPER_INJECT_COST
#undef SLEEPER_INJECT_COST
@@ -71,6 +71,5 @@
/mob/living/simple_mob/proc/remove_eyes()
cut_overlay(eye_layer)
/mob/living/simple_mob/gib()
..(icon_gib,1,icon) // we need to specify where the gib animation is stored
..(icon_gib,1,icon) // we need to specify where the gib animation is stored
@@ -0,0 +1,8 @@
/mob/living/simple_mob
gib_on_butchery = TRUE
/mob/living/simple_mob/can_butcher(var/mob/user, var/obj/item/I) // Override for special butchering checks.
. = ..()
if(. && (!is_sharp(I) || !has_edge(I)))
return FALSE
@@ -68,9 +68,9 @@
else
var/datum/gender/T = gender_datums[src.get_visible_gender()]
to_chat(user, "<span class='notice'>\The [src] is dead, medical items won't bring [T.him] back to life.</span>") // the gender lookup is somewhat overkill, but it functions identically to the obsolete gender macros and future-proofs this code
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
if(istype(O, /obj/item/weapon/material/knife))
harvest(user)
if(can_butcher(user, O)) //if the animal can be butchered, do so and return. It's likely to be gibbed.
harvest(user, O)
return
if(user.a_intent == I_HELP && harvest_tool && istype(O, harvest_tool) && stat != DEAD)
if(world.time > (harvest_recent + harvest_cooldown))
@@ -17,7 +17,7 @@
/mob/living/simple_mob/examine(mob/user)
. = ..()
if(user && harvest_tool && (get_dist(user, src) <= 3))
if(stat != DEAD && user && harvest_tool && (get_dist(user, src) <= 3))
. += "<span class='notice'>\The [src] can be [harvest_verb] with a [initial(harvest_tool.name)] every [round(harvest_cooldown, 0.1)] minutes.</span>"
var/time_to_harvest = (harvest_recent + harvest_cooldown) - world.time
if(time_to_harvest > 0)
+9 -1
View File
@@ -14,6 +14,8 @@
handle_special()
handle_guts()
return TRUE
@@ -94,7 +96,7 @@
throw_alert("oxy", /obj/screen/alert/too_much_oxy)
else
clear_alert("oxy")
if(min_tox && Environment.gas["phoron"] < min_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /obj/screen/alert/not_enough_tox)
@@ -137,6 +139,12 @@
else
adjustOxyLoss(-unsuitable_atoms_damage)
/mob/living/simple_mob/proc/handle_guts()
for(var/obj/item/organ/OR in internal_organs)
OR.process()
for(var/obj/item/organ/OR in organs)
OR.process()
/mob/living/simple_mob/proc/handle_supernatural()
if(purge)
@@ -57,8 +57,6 @@
var/response_harm = "tries to hurt" // If clicked on harm intent
var/list/friends = list() // Mobs on this list wont get attacked regardless of faction status.
var/harm_intent_damage = 3 // How much an unarmed harm click does to this mob.
var/meat_amount = 0 // How much meat to drop from this mob when butchered
var/obj/meat_type // The meat object to drop
var/list/loot_list = list() // The list of lootable objects to drop, with "/path = prob%" structure
var/obj/item/weapon/card/id/myid// An ID card if they have one to give them access to stuff.
@@ -158,6 +156,10 @@
// don't process me if there's nobody around to see it
low_priority = TRUE
// Used for if the mob can drop limbs. Overrides species dmi.
var/limb_icon
// Used for if the mob can drop limbs. Overrides the icon cache key, so it doesn't keep remaking the icon needlessly.
var/limb_icon_key
/mob/living/simple_mob/Initialize()
verbs -= /mob/verb/observe
@@ -170,8 +172,31 @@
if(has_eye_glow)
add_eyes()
return ..()
if(LAZYLEN(organs))
for(var/path in organs)
if(ispath(path))
var/obj/item/organ/external/neworg = new path(src)
neworg.name = "[name] [neworg.name]"
neworg.meat_type = meat_type
if(limb_icon)
neworg.force_icon = limb_icon
neworg.force_icon_key = limb_icon_key
organs |= neworg
organs -= path
if(LAZYLEN(internal_organs))
for(var/path in internal_organs)
if(ispath(path))
var/obj/item/organ/neworg = new path(src)
neworg.name = "[name] [neworg.name]"
neworg.meat_type = meat_type
internal_organs |= neworg
internal_organs -= path
return ..()
/mob/living/simple_mob/Destroy()
default_language = null
@@ -190,7 +215,6 @@
update_icon()
..()
//Client attached
/mob/living/simple_mob/Login()
. = ..()
@@ -269,27 +293,6 @@
/mob/living/simple_mob/get_speech_ending(verb, var/ending)
return verb
// Harvest an animal's delicious byproducts
/mob/living/simple_mob/proc/harvest(var/mob/user, var/invisible)
var/actual_meat_amount = max(1,(meat_amount/2))
var/attacker_name = user.name
if(invisible)
attacker_name = "someone"
if(meat_type && actual_meat_amount>0 && (stat == DEAD))
for(var/i=0;i<actual_meat_amount;i++)
var/obj/item/meat = new meat_type(get_turf(src))
meat.name = "[src.name] [meat.name]"
if(issmall(src))
user.visible_message("<span class='danger'>[attacker_name] chops up \the [src]!</span>")
new/obj/effect/decal/cleanable/blood/splatter(get_turf(src))
qdel(src)
else
user.visible_message("<span class='danger'>[attacker_name] butchers \the [src] messily!</span>")
gib()
/mob/living/simple_mob/is_sentient()
return mob_class & MOB_CLASS_HUMANOID|MOB_CLASS_ANIMAL|MOB_CLASS_SLIME // Update this if needed.
@@ -6,4 +6,17 @@
response_disarm = "shoos"
response_harm = "hits"
ai_holder_type = /datum/ai_holder/simple_mob/melee
ai_holder_type = /datum/ai_holder/simple_mob/melee
internal_organs = list(\
/obj/item/organ/internal/brain,\
/obj/item/organ/internal/heart,\
/obj/item/organ/internal/liver,\
/obj/item/organ/internal/stomach,\
/obj/item/organ/internal/intestine,\
/obj/item/organ/internal/lungs\
)
butchery_loot = list(\
/obj/item/stack/animalhide = 3\
)
@@ -110,6 +110,10 @@
var/poison_chance = 10 // Chance for injection to occur.
var/poison_per_bite = 5 // Amount added per injection.
butchery_loot = list(\
/obj/item/stack/material/chitin = 1\
)
/mob/living/simple_mob/animal/giant_spider/apply_melee_effects(var/atom/A)
if(isliving(A))
var/mob/living/L = A
+301
View File
@@ -0,0 +1,301 @@
#define BULLET_AP_DIVISOR 200
#define AP_DIVISOR 4152
#define ARMOR_Y_INTERCEPT 0.2
#define ARMOR_SLOPE 0.017
#define PENETRATION_PROBABILITY_EXP_BASE 2
#define PENETRATION_PROBABILITY_EXP_MULT 30
#define BULLET_DEFLECTED_PAIN_DIVISOR 5000
#define BULLET_DEFLECTED_BULLET_DIVISOR 70
#define BULLET_DEFLECTED_MELEE_DIVISOR 280
#define BULLET_DEFLECTED_PAIN_EXPONENT 1.5
#define BULLET_DEFLECTED_BRUISE_SUBTRACT 5
GLOBAL_VAR_INIT(SKIN_LOSS_COEFFICIENT,16)
GLOBAL_VAR_INIT(ARMOR_LOSS_COEFFICIENT,150)
GLOBAL_VAR_INIT(ARMOR_LOSS_MIN_MULT,0.5)
GLOBAL_VAR_INIT(ARMOR_LOSS_MIN_ARMOR,20)
GLOBAL_VAR_INIT(INTERNAL_LOSS_COEFFICIENT,195)
#define ORGAN_LOSS_COEFFICIENT 350
#define HIT_VITAL_ORGAN_CHANCE 35
#define BONE_HIT_CHANCE_UNENCASED 45
#define BONE_HIT_CHANCE_ENCASED 80
GLOBAL_VAR_INIT(BONE_JOULES_PERHP_AVG,2)
GLOBAL_VAR_INIT(BONE_JOULES_PERHP_DEV,1)
GLOBAL_VAR_INIT(BONE_JOULES_MIN,100)
#define BONE_HP_AVG 25
GLOBAL_VAR_INIT(HOLLOW_POINT_VELLOSS_BONUS,2.35)
GLOBAL_VAR_INIT(HOLLOW_POINT_CONVERSION_EFF,1.15)
#define PROB_LEAVE_EARLY_FIRST 20
#define PROB_LEAVE_EARLY_SECOND 40
GLOBAL_VAR_INIT(ENERGY_DAMAGE_FLESH_FACTOR,0.03)
GLOBAL_VAR_INIT(ENERGY_DAMAGE_ORGAN_FACTOR,0.035)
#ifndef GAUSSIAN_RANDOM
#define GAUSSIAN_RANDOM(vars...) ((-2*log(rand()))**0.5 * cos(6.28318530718*rand()))
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////// CADYN'S BALLISTICS ////////////////////////////////////////////////////////////////////////// ORIGINAL FROM CHOMPSTATION ////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/mob/living/proc/handle_ballistics(var/obj/item/projectile/bullet/P, var/def_zone)
var/list/updated_organ_weight = list()
var/ballistic_armor = getarmor(def_zone, "bullet")
var/melee_armor = getarmor(def_zone, "melee")
var/obj/item/organ/external/hit_organ
var/mob/living/carbon/human/H = src
if(istype(H))
hit_organ = H.get_organ(def_zone)
for(var/ext_organ in ballistic_variables["organ_hit_weight"])
var/list/input = list()
var/obj/item/organ/external/ref_ext_organ = H.get_organ(ext_organ)
for(var/int_organ in ballistic_variables["organ_hit_weight"][ext_organ])
var/ref_int_organ = H.internal_organs_by_name[int_organ]
if(ref_ext_organ && ref_int_organ && (ref_int_organ in ref_ext_organ.internal_organs))
input[ref_int_organ] = ballistic_variables["organ_hit_weight"][ext_organ][int_organ]
if(input.len)
updated_organ_weight[ref_ext_organ] = input
//log_and_message_admins("Beginning handle_ballistics")
var/penetration_chance = armor_penetration_probability(ballistic_armor,P)
if(!prob(penetration_chance)) //Boo-hoo we got deflected. Do boring agony/bruises stuff.
//log_and_message_admins("Bullet deflected")
var/pain_hit = hit_organ ? "into your [hit_organ]" : "into you"
var/hurt_value = P.velocity * P.grains / (BULLET_DEFLECTED_PAIN_DIVISOR * (1 + ballistic_armor/BULLET_DEFLECTED_BULLET_DIVISOR + melee_armor/BULLET_DEFLECTED_MELEE_DIVISOR)) //Better armor spreads out the energy better.
var/hurt_value_pain = hurt_value ** BULLET_DEFLECTED_PAIN_EXPONENT
var/hurt_value_bruise = max(0,hurt_value-BULLET_DEFLECTED_BRUISE_SUBTRACT)
var/absorber = ballistic_armor ? "armor" : "body" //There is a super tiny chance that small rounds can get deflected without armor, so this is just incase.
to_chat(src,"<span class='warning'>You feel the energy of the bullet painfully transfered [pain_hit] as your [absorber] deflects it!</span>")
apply_damage(hurt_value_pain,HALLOSS,def_zone)
if(hurt_value_bruise)
apply_damage(hurt_value_bruise,BRUTE,def_zone)
P.sub_velocity(P.velocity)
return 2
else //Now the FUN begins
//log_and_message_admins("Bullet penetrated")
var/area_over_mass = P.diam * P.diam / P.grains
//Most of these calculations don't involve energies because I'm treating flesh and organic tissue as a fluid since it's squishy and stuff.
//Since drag is proportional to velocity, we can do things on an m*v basis instead of an mv^2 basis.
//Obviously bones are more solid, so we do actual energy calculations for that.
var/conversion_efficiency = P.hollow_point ? GLOB.HOLLOW_POINT_CONVERSION_EFF : 1
var/vel_loss_multiplier = P.hollow_point ? GLOB.HOLLOW_POINT_VELLOSS_BONUS : 1
var/energy_dumped_organic = 0
var/vel_lost_armor = ballistic_armor >= GLOB.ARMOR_LOSS_MIN_ARMOR ? GLOB.ARMOR_LOSS_COEFFICIENT * area_over_mass * ((1 + GLOB.ARMOR_LOSS_MIN_MULT) - penetration_chance/100) : 0
P.sub_velocity(vel_lost_armor)
var/energy_past = P.energy
var/internal_loss = vel_loss_multiplier * GLOB.INTERNAL_LOSS_COEFFICIENT * area_over_mass
var/vel_lost_skin = vel_loss_multiplier * GLOB.SKIN_LOSS_COEFFICIENT * area_over_mass
P.sub_velocity(vel_lost_skin + internal_loss)
energy_dumped_organic += (energy_past - P.energy)
if(prob(PROB_LEAVE_EARLY_FIRST) || !P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return 1
if(hit_organ)
//log_and_message_admins("organ_handle_ballistics called. hit_organ = [hit_organ], energy_dumped_organic = [energy_dumped_organic], internal_loss = [internal_loss], ballistic_armor = [ballistic_armor], P.velocity = [P.velocity], P.energy = [P.energy]")
return organ_handle_ballistics(P,hit_organ,energy_dumped_organic,internal_loss,ballistic_armor,updated_organ_weight)
else
//log_and_message_admins("general_handle_ballistics called.")
return general_handle_ballistics(P,def_zone,energy_dumped_organic,internal_loss,ballistic_armor)
/mob/living/proc/organ_handle_ballistics(var/obj/item/projectile/bullet/P,var/obj/item/organ/external/hit_organ,var/energy_dumped_organic,var/internal_loss,var/ballistic_armor,var/list/updated_organ_weight)
var/conversion_efficiency = P.hollow_point ? GLOB.HOLLOW_POINT_CONVERSION_EFF : 1
var/energy_past
var/area_over_mass = P.diam * P.diam / P.grains
var/bone_chance = BONE_HIT_CHANCE_UNENCASED
if(hit_organ.encased)
bone_chance = BONE_HIT_CHANCE_ENCASED
else
bone_chance = ballistic_variables["bone_chance_unencased"][hit_organ.organ_tag]
//log_and_message_admins("Bone hit chance is [bone_chance], organ is [hit_organ]")
if(prob(bone_chance))
var/energy_to_fracture = max(GLOB.BONE_JOULES_MIN, hit_organ.min_broken_damage * (GAUSSIAN_RANDOM()*GLOB.BONE_JOULES_PERHP_DEV + GLOB.BONE_JOULES_PERHP_AVG))
//log_and_message_admins("Bone hit, bone_chance1. energy_to_fracture = [energy_to_fracture]")
if(energy_to_fracture>=P.energy) //We don't have enough energy to get through the bone. This is the end for us!
energy_dumped_organic += P.energy/2 //About half of our remaining energy will go into fucking up this boi, the rest is absorbed by the bone
P.sub_velocity(P.velocity)
//log_and_message_admins("Insufficient projectile energy. Stopping projectile.")
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return 2
else
//log_and_message_admins("Sufficient projectile energy to pass through bone.")
P.sub_energy(energy_to_fracture)
energy_dumped_organic += P.energy / 3 //About a third of the energy that goes into fracturing the bone also goes into fucking up tissues.
if(!(hit_organ.status & ORGAN_BROKEN))
//log_and_message_admins("Fracturing [hit_organ]")
hit_organ.fracture()
//log_and_message_admins("Bone checking done. hit_organ = [hit_organ], energy_dumped_organic = [energy_dumped_organic], internal_loss = [internal_loss], ballistic_armor = [ballistic_armor], P.velocity = [P.velocity], P.energy = [P.energy]")
if(hit_organ.internal_organs.len && P.velocity > area_over_mass*ORGAN_LOSS_COEFFICIENT && prob(ballistic_variables["organ_hit_chance"][hit_organ.organ_tag]) && updated_organ_weight[hit_organ] && updated_organ_weight[hit_organ].len)
//log_and_message_admins("Organ was hit by bullet.")
energy_past = P.energy
P.sub_velocity(internal_loss)
damage_organ_energy((energy_past - P.energy) * conversion_efficiency, pickweight(updated_organ_weight[hit_organ]))
if(!P.velocity)
//log_and_message_admins("Organ stopped bullet.")
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return 2
//log_and_message_admins("Organ check done, hit_organ = [hit_organ], energy_dumped_organic = [energy_dumped_organic], internal_loss = [internal_loss], ballistic_armor = [ballistic_armor], P.velocity = [P.velocity], P.energy = [P.energy]")
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += energy_past - P.energy
if(!P.velocity || (hit_organ.organ_tag in ballistic_variables["organ_leave_early"]) || prob(PROB_LEAVE_EARLY_SECOND))
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return P.velocity ? -1 : 2
//log_and_message_admins("Internal_loss 2 stopped bullet")
//log_and_message_admins("Internal_loss 2 completed, hit_organ = [hit_organ], energy_dumped_organic = [energy_dumped_organic], internal_loss = [internal_loss], ballistic_armor = [ballistic_armor], P.velocity = [P.velocity], P.energy = [P.energy]")
if(prob(bone_chance))
var/energy_to_fracture = max(GLOB.BONE_JOULES_MIN, hit_organ.min_broken_damage * (GAUSSIAN_RANDOM()*GLOB.BONE_JOULES_PERHP_DEV + GLOB.BONE_JOULES_PERHP_AVG))
//log_and_message_admins("Bone hit, bone_chance1. energy_to_fracture = [energy_to_fracture]")
if(energy_to_fracture>=P.energy) //We don't have enough energy to get through the bone. This is the end for us!
energy_dumped_organic += P.energy/2 //About half of our remaining energy will go into fucking up this boi, the rest is absorbed by the bone
P.sub_velocity(P.velocity)
//log_and_message_admins("Insufficient projectile energy. Stopping projectile.")
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return 2
else
//log_and_message_admins("Sufficient projectile energy to pass through bone.")
P.sub_energy(energy_to_fracture)
energy_dumped_organic += P.energy / 3 //About a third of the energy that goes into fracturing the bone also goes into fucking up tissues.
if(!(hit_organ.status & ORGAN_BROKEN))
//log_and_message_admins("Fracturing [hit_organ]")
hit_organ.fracture()
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += energy_past - P.energy
if(!P.velocity)
//log_and_message_admins("Internal_loss 3 stopped bullet")
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return 2
//log_and_message_admins("Internal_loss 3 completed. hit_organ = [hit_organ], energy_dumped_organic = [energy_dumped_organic], internal_loss = [internal_loss], ballistic_armor = [ballistic_armor], P.velocity = [P.velocity], P.energy = [P.energy]")
var/penetration_chance = armor_penetration_probability(ballistic_armor,P)
if(prob(penetration_chance))
//log_and_message_admins("Projectile exiting.")
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return -1
else
//log_and_message_admins("Projectile continuing inside body")
energy_dumped_organic += P.energy / 3
P.sub_velocity(P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,hit_organ.organ_tag)
return 2
/mob/living/proc/general_handle_ballistics(var/obj/item/projectile/bullet/P,var/def_zone,var/energy_dumped_organic,var/internal_loss,var/ballistic_armor)
var/conversion_efficiency = P.hollow_point ? GLOB.HOLLOW_POINT_CONVERSION_EFF : 1
var/energy_past
var/area_over_mass = P.diam * P.diam / P.grains
var/bone_chance = BONE_HIT_CHANCE_UNENCASED
//if(def_zone in ballistic_variables["bone_chance_unencased"])
//bone_chance = ballistic_variables["bone_chance_unencased"][def_zone]
if(prob(bone_chance))
var/energy_to_fracture = max(GLOB.BONE_JOULES_MIN, BONE_HP_AVG * (GAUSSIAN_RANDOM()*GLOB.BONE_JOULES_PERHP_DEV + GLOB.BONE_JOULES_PERHP_AVG))
if(energy_to_fracture>=P.energy) //We don't have enough energy to get through the bone. This is the end for us!
energy_dumped_organic += P.energy/2 //About half of our remaining energy will go into fucking up this boi, the rest is absorbed by the bone
P.sub_velocity(P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return 2
else
P.sub_energy(energy_to_fracture)
energy_dumped_organic += P.energy / 3 //About a third of the energy that goes into fracturing the bone also goes into fucking up tissues.
if(P.velocity > area_over_mass * ORGAN_LOSS_COEFFICIENT && prob(HIT_VITAL_ORGAN_CHANCE))
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += (energy_past - P.energy) * 1.5
if(!P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return 2
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += energy_past - P.energy
if(!P.velocity || (def_zone in ballistic_variables["organ_leave_early"]) || prob(PROB_LEAVE_EARLY_SECOND))
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return P.velocity ? -1 : 2
if(prob(bone_chance))
var/energy_to_fracture = max(GLOB.BONE_JOULES_MIN, BONE_HP_AVG * (GAUSSIAN_RANDOM()*GLOB.BONE_JOULES_PERHP_DEV + GLOB.BONE_JOULES_PERHP_AVG))
if(energy_to_fracture>=P.energy) //We don't have enough energy to get through the bone. This is the end for us!
energy_dumped_organic += P.energy/2 //About half of our remaining energy will go into fucking up this boi, the rest is absorbed by the bone
P.sub_velocity(P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return 2
else
P.sub_energy(energy_to_fracture)
energy_dumped_organic += P.energy / 3 //About a third of the energy that goes into fracturing the bone also goes into fucking up tissues.
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += energy_past - P.energy
if(!P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return 2
var/penetration_chance = armor_penetration_probability(ballistic_armor,P)
if(prob(penetration_chance))
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return -1
else
energy_dumped_organic += P.energy / 3
P.sub_velocity(P.velocity)
energy_to_damage(energy_dumped_organic * conversion_efficiency,def_zone)
return 2
/mob/living/proc/damage_organ_energy(var/energy,var/obj/item/organ/internal/target)
var/damage = round(energy*GLOB.ENERGY_DAMAGE_ORGAN_FACTOR)
//log_and_message_admins("damage_organ_energy([energy]) : [target].take_damage([damage])")
target.take_damage(damage)
return
/mob/living/proc/energy_to_damage(var/energy,var/def_zone)
var/damage = round(energy*GLOB.ENERGY_DAMAGE_FLESH_FACTOR)
//log_and_message_admins("energy_to_damage([energy]) : apply_damage([damage], BRUTE, [def_zone])")
apply_damage(damage, BRUTE, def_zone)
return
/mob/living/proc/armor_penetration_probability(var/armor, var/obj/item/projectile/bullet/P)
var/bullet_ap_value = (1+((P.armor_penetration)/BULLET_AP_DIVISOR))
var/ap_value = P.velocity * bullet_ap_value * (P.grains / P.diam)**(2/3) / AP_DIVISOR
var/armor_value = ARMOR_Y_INTERCEPT + ARMOR_SLOPE * armor
var/penetration_chance = 100 / (1 + PENETRATION_PROBABILITY_EXP_BASE**(-PENETRATION_PROBABILITY_EXP_MULT*(ap_value - armor_value)))
return penetration_chance
/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone)
//log_and_message_admins("bullet_act_ch")
var/obj/item/projectile/bullet/B = P
if(P.check_armour == "bullet" && istype(B) && !B.old_bullet_act)
//log_and_message_admins("is bullet")
return handle_ballistics(P,def_zone)
else
//log_and_message_admins("is not bullet")
return ..()
/mob/living
var/list/ballistic_variables = list(\
"bone_chance_unencased" = list(BP_HEAD = 5, BP_TORSO = 20, BP_GROIN = 20, BP_L_FOOT = 80, BP_R_FOOT = 80, BP_L_LEG = 35, BP_R_LEG = 35, BP_L_ARM = 65, BP_R_ARM = 65, BP_L_HAND = 80, BP_R_HAND = 80), \
"organ_leave_early" = list("l_arm", "r_arm", "l_hand", "r_hand", "l_foot", "r_foot"), \
"organ_hit_weight" = list(\
BP_HEAD = list(\
/*Standard organs*/O_BRAIN = 90, O_EYES = 5, \
/*Diona organs*/O_RESPONSE = 10, O_RESPONSE = 15, O_GBLADDER = 15, \
/*Replicant organs*/O_VRLINK = 20, \
/*Xeno organs*/O_ACID = 10, O_RESIN = 10), \
BP_TORSO = list(\
/*Standard organs*/O_HEART = 5, O_LUNGS = 50, O_SPLEEN = 15, O_VOICE = 10, \
/*Synth organs*/O_CELL = 5, O_PUMP = 15, O_HEATSINK = 35, O_CYCLER = 15, O_DIAGNOSTIC = 10, \
/*Promethean organs*/O_REGBRUTE = 20, O_REGBURN = 20, O_REGOXY = 20, O_REGTOX = 20, \
/*Diona organs*/O_STRATA = 35, O_BRAIN = 20, O_NUTRIENT = 10, \
/*Replicant organs*/O_AREJECT = 35, \
/*Xeno organs*/O_PLASMA = 10, O_HIVE = 10), \
BP_GROIN = list(\
/*Standard organs*/O_INTESTINES = 50, O_STOMACH = 20, O_LIVER = 20, O_KIDNEYS = 15, O_APPENDIX = 5, \
/*Diona organs*/O_POLYP = 10, O_ANCHOR = 15, \
/*Replicant organs*/O_VENTC = 20, \
/*Xeno organs*/ O_EGG = 25) ), \
"organ_hit_chance" = list(BP_HEAD = 95, BP_TORSO = 90, BP_GROIN = 90) )
@@ -0,0 +1,236 @@
#define BULLET_PENETRATED 1<<0
#define BULLET_BONECHECK1_TRUE 1<<1
#define BULLET_ORGANCHECK_TRUE 1<<2
#define BULLET_BONECHECK2_TRUE 1<<3
#define BULLET_PASSED_LEAVE_EARLY 1<<4
#define BULLET_PASSED_BONECHECK1 1<<5
#define BULLET_PASSED_ORGANCHECK 1<<6
#define BULLET_PASSED_INTERNALCHECK2 1<<7
#define BULLET_PASSED_BONECHECK2 1<<8
#define BULLET_PASSED_INTERNALCHECK3 1<<9
#define BULLET_TESTS 150
/mob/living/carbon/human/monkey/testerboyo
name = "testerboyo"
var/the_big_armor = 0
/mob/living/carbon/human/monkey/testerboyo/getarmor(var/def_zone,var/type)
return the_big_armor
/proc/test_all_ballistics()
var/mob/living/carbon/human/monkey/testerboyo/tester = new()
var/obj/item/projectile/bullet/pistol/test1 = new()
var/obj/item/projectile/bullet/pistol/ap/test2 = new()
var/obj/item/projectile/bullet/pistol/hp/test3 = new()
var/obj/item/projectile/bullet/pistol/medium/test4 = new()
var/obj/item/projectile/bullet/pistol/medium/ap/test5 = new()
var/obj/item/projectile/bullet/pistol/medium/hp/test6 = new()
var/obj/item/projectile/bullet/pistol/strong/test7 = new()
var/obj/item/projectile/bullet/shotgun/test8 = new()
var/obj/item/projectile/bullet/shotgun/buckshot/test9 = new()
var/obj/item/projectile/bullet/rifle/a762/test10 = new()
var/obj/item/projectile/bullet/rifle/a762/ap/test11 = new()
var/obj/item/projectile/bullet/rifle/a762/hp/test12 = new()
var/obj/item/projectile/bullet/rifle/a545/test13 = new()
var/obj/item/projectile/bullet/rifle/a545/ap/test14 = new()
var/obj/item/projectile/bullet/rifle/a545/hp/test15 = new()
var/obj/item/projectile/bullet/rifle/a145/test16 = new()
var/obj/item/projectile/bullet/rifle/a145/highvel/test17 = new()
var/obj/item/projectile/bullet/rifle/a44rifle/test18 = new()
var/obj/item/projectile/bullet/rifle/a95/test19 = new()
var/obj/item/projectile/bullet/rifle/a762/lmg/test20 = new()
test_ballistics(test1,tester)
test_ballistics(test2,tester)
test_ballistics(test3,tester)
test_ballistics(test4,tester)
test_ballistics(test5,tester)
test_ballistics(test6,tester)
test_ballistics(test7,tester)
test_ballistics(test8,tester)
test_ballistics(test9,tester)
test_ballistics(test10,tester)
test_ballistics(test11,tester)
test_ballistics(test12,tester)
test_ballistics(test13,tester)
test_ballistics(test14,tester)
test_ballistics(test15,tester)
test_ballistics(test16,tester)
test_ballistics(test17,tester)
test_ballistics(test18,tester)
test_ballistics(test19,tester)
test_ballistics(test20,tester)
qdel(tester)
qdel(test1)
qdel(test2)
qdel(test3)
qdel(test4)
qdel(test5)
qdel(test6)
qdel(test7)
qdel(test8)
qdel(test9)
qdel(test10)
qdel(test11)
qdel(test12)
qdel(test13)
qdel(test14)
qdel(test15)
qdel(test16)
qdel(test17)
qdel(test18)
qdel(test19)
qdel(test20)
/proc/test_ballistics(var/obj/item/projectile/bullet/P,var/mob/living/carbon/human/monkey/testerboyo/tester)
var/list/data = list()
for(var/armor_level in list(0,5,10,20,50,80))
data["[armor_level]"] = list()
data["[armor_level]"]["average"] = list()
tester.the_big_armor = armor_level
var/bp_num = 0
for(var/body_part in list(BP_TORSO,BP_HEAD,BP_R_LEG,BP_R_ARM,BP_R_HAND))
bp_num++
data["[armor_level]"][body_part] = list()
for(var/i = 0,i<BULLET_TESTS,i++)
P.velocity = initial(P.velocity)
P.sub_velocity(0)
var/out = tester.handle_ballistics(P,body_part)
for(var/x = 0,x<10,x++)
var/input = (out["chex"] & (1<<x)) ? 1 : 0
data["[armor_level]"][body_part]["[x]"] += input
data["[armor_level]"]["average"]["[x]"] += input
data["[armor_level]"][body_part]["10"] += out["energy"]
data["[armor_level]"][body_part]["10"] /= BULLET_TESTS
data["[armor_level]"]["average"]["10"] += data["[armor_level]"][body_part]["10"]
for(var/x = 0,x<11,x++)
data["[armor_level]"]["average"]["[x]"] /= bp_num
for(var/entry in data["[armor_level]"])
var/string_to_send = "[P.type]: Armor level [armor_level]: [entry]:"
for(var/x = 0,x<11,x++)
string_to_send += " [x]:[data["[armor_level]"][entry]["[x]"]]"
log_and_message_admins(string_to_send)
/proc/lazy_return_testing(var/chex,var/energy)
return list("chex" = chex, "energy" = energy)
/mob/living/carbon/human/monkey/testerboyo/handle_ballistics(var/obj/item/projectile/bullet/P, var/def_zone)
var/chex = 0
var/list/updated_organ_weight = list()
var/ballistic_armor = getarmor(def_zone, "bullet")
var/melee_armor = getarmor(def_zone, "melee")
var/obj/item/organ/external/hit_organ
var/mob/living/carbon/human/H = src
if(istype(H))
hit_organ = H.get_organ(def_zone)
for(var/ext_organ in ballistic_variables["organ_hit_weight"])
var/list/input = list()
var/obj/item/organ/external/ref_ext_organ = H.get_organ(ext_organ)
for(var/int_organ in ballistic_variables["organ_hit_weight"][ext_organ])
var/ref_int_organ = H.internal_organs_by_name[int_organ]
if(ref_ext_organ && ref_int_organ && (ref_int_organ in ref_ext_organ.internal_organs))
input[ref_int_organ] = ballistic_variables["organ_hit_weight"][ext_organ][int_organ]
if(input.len)
updated_organ_weight[ref_ext_organ] = input
var/penetration_chance = armor_penetration_probability(ballistic_armor,P)
if(!prob(penetration_chance)) //Boo-hoo we got deflected. Do boring agony/bruises stuff.
var/pain_hit = hit_organ ? "into your [hit_organ]" : "into you"
var/hurt_value = P.velocity * P.grains / (BULLET_DEFLECTED_PAIN_DIVISOR * (1 + ballistic_armor/BULLET_DEFLECTED_BULLET_DIVISOR + melee_armor/BULLET_DEFLECTED_MELEE_DIVISOR)) //Better armor spreads out the energy better.
var/hurt_value_pain = hurt_value ** BULLET_DEFLECTED_PAIN_EXPONENT
var/hurt_value_bruise = max(0,hurt_value-BULLET_DEFLECTED_BRUISE_SUBTRACT)
var/absorber = ballistic_armor ? "armor" : "body" //There is a super tiny chance that small rounds can get deflected without armor, so this is just incase.
to_chat(src,"<span class='warning'>You feel the energy of the bullet painfully transfered [pain_hit] as your [absorber] deflects it!</span>")
apply_damage(hurt_value_pain,HALLOSS,def_zone)
if(hurt_value_bruise)
apply_damage(hurt_value_bruise,BRUTE,def_zone)
P.sub_velocity(P.velocity)
return lazy_return_testing(chex,0)
else //Now the FUN begins
chex |= BULLET_PENETRATED
var/area_over_mass = P.diam * P.diam / P.grains
//Most of these calculations don't involve energies because I'm treating flesh and organic tissue as a fluid since it's squishy and stuff.
//Since drag is proportional to velocity, we can do things on an m*v basis instead of an mv^2 basis.
//Obviously bones are more solid, so we do actual energy calculations for that.
//var/conversion_efficiency = P.hollow_point ? 0.925 : 1
var/vel_loss_multiplier = P.hollow_point ? GLOB.HOLLOW_POINT_VELLOSS_BONUS : 1
var/energy_dumped_organic = 0
var/vel_lost_armor = ballistic_armor >= GLOB.ARMOR_LOSS_MIN_ARMOR ? GLOB.ARMOR_LOSS_COEFFICIENT * area_over_mass * ((1 + GLOB.ARMOR_LOSS_MIN_MULT) - penetration_chance/100) : 0
P.sub_velocity(vel_lost_armor)
var/energy_past = P.energy
var/internal_loss = vel_loss_multiplier * GLOB.INTERNAL_LOSS_COEFFICIENT * area_over_mass
var/vel_lost_skin = vel_loss_multiplier * GLOB.SKIN_LOSS_COEFFICIENT * area_over_mass
P.sub_velocity(vel_lost_skin + internal_loss)
energy_dumped_organic += (energy_past - P.energy)
if(prob(PROB_LEAVE_EARLY_FIRST) || !P.velocity)
return lazy_return_testing(chex,energy_dumped_organic)
if(hit_organ)
chex |= BULLET_PASSED_LEAVE_EARLY
return organ_handle_ballistics(P,hit_organ,energy_dumped_organic,internal_loss,ballistic_armor,updated_organ_weight,chex)
else
return general_handle_ballistics(P,def_zone,energy_dumped_organic,internal_loss,ballistic_armor)
/mob/living/carbon/human/monkey/testerboyo/organ_handle_ballistics(var/obj/item/projectile/bullet/P,var/obj/item/organ/external/hit_organ,var/energy_dumped_organic,var/internal_loss,var/ballistic_armor,var/list/updated_organ_weight,var/chex)
//var/conversion_efficiency = P.hollow_point ? 0.8 : 1
var/energy_past
var/area_over_mass = P.diam * P.diam / P.grains
var/bone_chance = BONE_HIT_CHANCE_UNENCASED
if(hit_organ.encased)
bone_chance = BONE_HIT_CHANCE_ENCASED
else
bone_chance = ballistic_variables["bone_chance_unencased"][hit_organ.organ_tag]
if(prob(bone_chance))
chex |= BULLET_BONECHECK1_TRUE
var/energy_to_fracture = max(GLOB.BONE_JOULES_MIN, hit_organ.min_broken_damage * (GAUSSIAN_RANDOM()*GLOB.BONE_JOULES_PERHP_DEV + GLOB.BONE_JOULES_PERHP_AVG))
if(energy_to_fracture>=P.energy) //We don't have enough energy to get through the bone. This is the end for us!
energy_dumped_organic += P.energy/2 //About half of our remaining energy will go into fucking up this boi, the rest is absorbed by the bone
P.sub_velocity(P.velocity)
return lazy_return_testing(chex,energy_dumped_organic)
else
P.sub_energy(energy_to_fracture)
energy_dumped_organic += energy_to_fracture / 3 //About a third of the energy that goes into fracturing the bone also goes into fucking up tissues.
chex |= BULLET_PASSED_BONECHECK1
if(hit_organ.internal_organs.len && P.velocity > area_over_mass*ORGAN_LOSS_COEFFICIENT && prob(ballistic_variables["organ_hit_chance"][hit_organ.organ_tag]) && updated_organ_weight[hit_organ] && updated_organ_weight[hit_organ].len)
chex |= BULLET_ORGANCHECK_TRUE
energy_past = P.energy
P.sub_velocity(internal_loss)
if(!P.velocity)
return lazy_return_testing(chex,energy_dumped_organic)
chex |= BULLET_PASSED_ORGANCHECK
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += energy_past - P.energy
if(!P.velocity || (hit_organ.organ_tag in ballistic_variables["organ_leave_early"]) || prob(PROB_LEAVE_EARLY_SECOND))
return lazy_return_testing(chex,energy_dumped_organic)
chex |= BULLET_PASSED_INTERNALCHECK2
if(prob(bone_chance))
chex |= BULLET_BONECHECK2_TRUE
var/energy_to_fracture = max(GLOB.BONE_JOULES_MIN, hit_organ.min_broken_damage * (GAUSSIAN_RANDOM()*GLOB.BONE_JOULES_PERHP_DEV + GLOB.BONE_JOULES_PERHP_AVG))
if(energy_to_fracture>=P.energy) //We don't have enough energy to get through the bone. This is the end for us!
energy_dumped_organic += P.energy/2 //About half of our remaining energy will go into fucking up this boi, the rest is absorbed by the bone
P.sub_velocity(P.velocity)
return lazy_return_testing(chex,energy_dumped_organic)
else
P.sub_energy(energy_to_fracture)
energy_dumped_organic += energy_to_fracture / 3 //About a third of the energy that goes into fracturing the bone also goes into fucking up tissues.
chex |= BULLET_PASSED_BONECHECK2
energy_past = P.energy
P.sub_velocity(internal_loss)
energy_dumped_organic += energy_past - P.energy
if(!P.velocity)
return lazy_return_testing(chex,energy_dumped_organic)
chex |= BULLET_PASSED_INTERNALCHECK3
var/penetration_chance = armor_penetration_probability(ballistic_armor,P)
if(prob(penetration_chance))
return lazy_return_testing(chex,energy_dumped_organic)
else
energy_dumped_organic += P.energy / 3
P.sub_velocity(P.velocity)
return lazy_return_testing(chex,energy_dumped_organic)
+34
View File
@@ -1022,6 +1022,40 @@ mob/proc/yank_out_object()
set hidden = 1
set_face_dir(client.client_dir(WEST))
// Begin VOREstation edit
/mob/verb/shiftnorth()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_y <= 16)
pixel_y++
is_shifted = TRUE
/mob/verb/shiftsouth()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_y >= -16)
pixel_y--
is_shifted = TRUE
/mob/verb/shiftwest()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_x >= -16)
pixel_x--
is_shifted = TRUE
mob/verb/shifteast()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_x <= 16)
pixel_x++
is_shifted = TRUE
// End VOREstation edit
/mob/proc/adjustEarDamage()
return
+1
View File
@@ -83,6 +83,7 @@
var/resting = 0 //Carbon
var/lying = 0
var/lying_prev = 0
var/is_shifted = FALSE // VoreStation Edit; pixel shifting
var/canmove = 1
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas.
@@ -1184,17 +1184,6 @@
bee_stripes
name = "bee stripes"
icon_state = "beestripes"
<<<<<<< HEAD
body_parts = list(BP_TORSO,BP_GROIN)
||||||| parent of bbd7600f00... Merge pull request #9307 from KasparoVy/port-some-citrp-stuff
body_parts = list(BP_TORSO,BP_GROIN)
vas_toes
name = "Bug Paws (Vasilissan)"
icon_state = "vas_toes"
color_blend_mode = ICON_MULTIPLY
body_parts = list(BP_L_FOOT,BP_R_FOOT)
=======
body_parts = list(BP_TORSO,BP_GROIN)
vas_toes
@@ -1269,4 +1258,4 @@
color_blend_mode = ICON_MULTIPLY
body_parts = list(BP_L_LEG,BP_R_LEG,BP_L_HAND,BP_R_HAND,BP_TORSO,BP_GROIN,BP_HEAD)
species_allowed = list(SPECIES_TESHARI)
>>>>>>> bbd7600f00... Merge pull request #9307 from KasparoVy/port-some-citrp-stuff
body_parts = list(BP_L_FOOT,BP_R_FOOT)