diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 87a09d538a..4d3418b98c 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -65,7 +65,11 @@ return ..() //////////////////////////////////////// +<<<<<<< HEAD /atom/movable/Move(atom/newloc, direct = 0, movetime) +======= +/atom/movable/Move(atom/newloc, direct = 0) +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved // Didn't pass enough info if(!loc || !newloc) return FALSE @@ -104,7 +108,10 @@ var/dest_z = get_z(newloc) // Do The Move +<<<<<<< HEAD glide_for(movetime) +======= +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved loc = newloc . = TRUE @@ -199,13 +206,18 @@ // If we moved, call Moved() on ourselves if(.) +<<<<<<< HEAD Moved(oldloc, direct, FALSE, movetime) +======= + Moved(oldloc, direct, FALSE) +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved // Update timers/cooldown stuff move_speed = world.time - l_move_time l_move_time = world.time last_move = direct // The direction you last moved // set_dir(direct) //Don't think this is necessary +<<<<<<< HEAD //Called after a successful Move(). By this point, we've already moved /atom/movable/proc/Moved(atom/old_loc, direction, forced = FALSE, movetime) @@ -215,6 +227,15 @@ if(riding_datum) riding_datum.handle_vehicle_layer() riding_datum.handle_vehicle_offsets() +======= + + // Handle any buckled mobs on this movable + if(has_buckled_mobs()) + handle_buckled_mob_movement(oldloc,direct) + +//Called after a successful Move(). By this point, we've already moved +/atom/movable/proc/Moved(atom/old_loc, direction, forced = FALSE) +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved return TRUE /atom/movable/set_dir(newdir) @@ -270,7 +291,11 @@ /atom/movable/proc/moveToNullspace() return doMove(null) +<<<<<<< HEAD /atom/movable/proc/doMove(atom/destination, direction, movetime) +======= +/atom/movable/proc/doMove(atom/destination) +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved var/atom/oldloc = loc var/area/old_area = get_area(oldloc) var/same_loc = oldloc == destination @@ -279,8 +304,12 @@ var/area/destarea = get_area(destination) // Do The Move +<<<<<<< HEAD glide_for(movetime) last_move = isnull(direction) ? 0 : direction +======= + last_move = 0 +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved loc = destination // Unset this in case it was set in some other proc. We're no longer moving diagonally for sure. diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 3d4c2ffe37..cbb757f49b 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -178,6 +178,7 @@ add_fingerprint(user) return M +<<<<<<< HEAD /atom/movable/proc/handle_buckled_mob_movement(atom/old_loc, direct, movetime) for(var/A in buckled_mobs) var/mob/living/L = A @@ -185,6 +186,14 @@ L.forceMove(loc, direct, movetime) L.last_move = last_move L.inertia_dir = last_move +======= +/atom/movable/proc/handle_buckled_mob_movement(atom/old_loc, direct) + for(var/A in buckled_mobs) + var/mob/living/L = A + L.forceMove(loc, direct) + L.last_move = last_move + L.inertia_dir = last_move +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved if(!buckle_dir) L.set_dir(dir) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index d471ba3840..0f7a3f94b9 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -145,6 +145,7 @@ playsound(src, 'sound/effects/roll.ogg', 100, 1) +<<<<<<< HEAD /obj/structure/bed/chair/office/handle_buckled_mob_movement(atom/new_loc, direction, movetime) for(var/A in buckled_mobs) var/mob/living/occupant = A @@ -152,6 +153,15 @@ occupant.Move(loc, direction, movetime) occupant.buckled = src if (occupant && (loc != occupant.loc)) +======= +/obj/structure/bed/chair/office/handle_buckled_mob_movement(atom/new_loc, direction) + for(var/A in buckled_mobs) + var/mob/living/occupant = A + occupant.buckled = null + occupant.Move(src.loc) + occupant.buckled = src + if (occupant && (src.loc != occupant.loc)) +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved if (propelled) for (var/mob/O in src.loc) if (O != occupant) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f5e2f59c89..7c038356cd 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /mob/living/carbon/Initialize() . = ..() //setup reagent holders @@ -412,4 +413,408 @@ else clear_alert("handcuffed") update_action_buttons() //some of our action buttons might be unusable when we're handcuffed. - update_inv_handcuffed() \ No newline at end of file + update_inv_handcuffed() +======= +/mob/living/carbon/Initialize() + . = ..() + //setup reagent holders + bloodstr = new/datum/reagents/metabolism/bloodstream(500, src) + ingested = new/datum/reagents/metabolism/ingested(500, src) + touching = new/datum/reagents/metabolism/touch(500, src) + reagents = bloodstr + if (!default_language && species_language) + default_language = GLOB.all_languages[species_language] + +/mob/living/carbon/Life() + ..() + + handle_viruses() + + // Increase germ_level regularly + if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level + germ_level++ + +/mob/living/carbon/Destroy() + qdel(ingested) + qdel(touching) + // We don't qdel(bloodstr) because it's the same as qdel(reagents) + for(var/guts in internal_organs) + qdel(guts) + for(var/food in stomach_contents) + qdel(food) + return ..() + +/mob/living/carbon/rejuvenate() + bloodstr.clear_reagents() + ingested.clear_reagents() + touching.clear_reagents() + ..() + +/mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE) + . = ..() + if(src.nutrition && src.stat != DEAD) + adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10) + if(src.m_intent == "run") + adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10) + + if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) + src.bodytemperature += 2 + + // Moving around increases germ_level faster + if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8)) + germ_level++ + +/mob/living/carbon/relaymove(var/mob/living/user, direction) + if((user in src.stomach_contents) && istype(user)) + if(user.last_special <= world.time) + user.last_special = world.time + 50 + src.visible_message("You hear something rumbling inside [src]'s stomach...") + var/obj/item/I = user.get_active_hand() + if(I && I.force) + var/d = rand(round(I.force / 4), I.force) + if(istype(src, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = src + var/obj/item/organ/external/organ = H.get_organ(BP_TORSO) + if (istype(organ)) + if(organ.take_damage(d, 0)) + H.UpdateDamageIcon() + H.updatehealth() + else + src.take_organ_damage(d) + user.visible_message("[user] attacks [src]'s stomach wall with the [I.name]!") + playsound(user.loc, 'sound/effects/attackblob.ogg', 50, 1) + + if(prob(src.getBruteLoss() - 50)) + for(var/atom/movable/A in stomach_contents) + A.loc = loc + stomach_contents.Remove(A) + src.gib() + +/mob/living/carbon/gib() + for(var/mob/M in src) + if(M in src.stomach_contents) + src.stomach_contents.Remove(M) + M.loc = src.loc + for(var/mob/N in viewers(src, null)) + if(N.client) + N.show_message(text("[M] bursts out of [src]!"), 2) + ..() + +/mob/living/carbon/attack_hand(mob/M as mob) + if(!istype(M, /mob/living/carbon)) return + if (ishuman(M)) + var/mob/living/carbon/human/H = M + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] + if (H.hand) + temp = H.organs_by_name["l_hand"] + if(temp && !temp.is_usable()) + to_chat(H, "You can't use your [temp.name]") + return + + return + +/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, var/stun = 1) + if(status_flags & GODMODE) return 0 //godmode + if(def_zone == "l_hand" || def_zone == "r_hand") //Diona (And any other potential plant people) hands don't get shocked. + if(species.flags & IS_PLANT) + return 0 + shock_damage *= siemens_coeff + if (shock_damage<1) + return 0 + + src.apply_damage(0.2 * shock_damage, BURN, def_zone, used_weapon="Electrocution") //shock the target organ + src.apply_damage(0.4 * shock_damage, BURN, BP_TORSO, used_weapon="Electrocution") //shock the torso more + src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part! + src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part! + + playsound(loc, "sparks", 50, 1, -1) + if (shock_damage > 15) + src.visible_message( + "[src] was electrocuted[source ? " by the [source]" : ""]!", \ + "You feel a powerful shock course through your body!", \ + "You hear a heavy electrical crack." \ + ) + else + src.visible_message( + "[src] was shocked[source ? " by the [source]" : ""].", \ + "You feel a shock course through your body.", \ + "You hear a zapping sound." \ + ) + + if(stun) + switch(shock_damage) + if(16 to 20) + Stun(2) + if(21 to 25) + Weaken(2) + if(26 to 30) + Weaken(5) + if(31 to INFINITY) + Weaken(10) //This should work for now, more is really silly and makes you lay there forever + + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, loc) + s.start() + + return shock_damage + +/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) + if (src.health >= config.health_threshold_crit) + if(src == M && istype(src, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = src + var/datum/gender/T = gender_datums[H.get_visible_gender()] + src.visible_message( \ + "[src] examines [T.himself].", \ + "You check yourself for injuries." \ + ) + + for(var/obj/item/organ/external/org in H.organs) + var/list/status = list() + var/brutedamage = org.brute_dam + var/burndamage = org.burn_dam + /* + if(halloss > 0) //Makes halloss show up as actual wounds on self examine. + if(prob(30)) + brutedamage += halloss + if(prob(30)) + burndamage += halloss + */ + switch(brutedamage) + if(1 to 20) + status += "bruised" + if(20 to 40) + status += "wounded" + if(40 to INFINITY) + status += "mangled" + + switch(burndamage) + if(1 to 10) + status += "numb" + if(10 to 40) + status += "blistered" + if(40 to INFINITY) + status += "peeling away" + + if(org.is_stump()) + status += "MISSING" + if(org.status & ORGAN_MUTATED) + status += "weirdly shapen" + if(org.dislocated == 2) + status += "dislocated" + if(org.status & ORGAN_BROKEN) + status += "hurts when touched" + if(org.status & ORGAN_DEAD) + status += "is bruised and necrotic" + if(!org.is_usable() || org.is_dislocated()) + status += "dangling uselessly" + if(status.len) + src.show_message("My [org.name] is [english_list(status)].",1) + else + src.show_message("My [org.name] is OK.",1) + + if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit)) + H.play_xylophone() + else if (on_fire) + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + if (M.on_fire) + M.visible_message("[M] tries to pat out [src]'s flames, but to no avail!", + "You try to pat out [src]'s flames, but to no avail! Put yourself out first!") + else + M.visible_message("[M] tries to pat out [src]'s flames!", + "You try to pat out [src]'s flames! Hot!") + if(do_mob(M, src, 15)) + src.adjust_fire_stacks(-0.5) + if (prob(10) && (M.fire_stacks <= 0)) + M.adjust_fire_stacks(1) + M.IgniteMob() + if (M.on_fire) + M.visible_message("The fire spreads from [src] to [M]!", + "The fire spreads to you as well!") + else + src.adjust_fire_stacks(-0.5) //Less effective than stop, drop, and roll - also accounting for the fact that it takes half as long. + if (src.fire_stacks <= 0) + M.visible_message("[M] successfully pats out [src]'s flames.", + "You successfully pat out [src]'s flames.") + src.ExtinguishMob() + src.fire_stacks = 0 + else + if (istype(src,/mob/living/carbon/human) && src:w_uniform) + var/mob/living/carbon/human/H = src + H.w_uniform.add_fingerprint(M) + + var/show_ssd + var/mob/living/carbon/human/H = src + var/datum/gender/T = gender_datums[H.get_visible_gender()] // make sure to cast to human before using get_gender() or get_visible_gender()! + if(istype(H)) show_ssd = H.species.show_ssd + if(show_ssd && !client && !teleop) + M.visible_message("[M] shakes [src] trying to wake [T.him] up!", \ + "You shake [src], but [T.he] [T.does] not respond... Maybe [T.he] [T.has] S.S.D?") + else if(lying || src.sleeping) + src.sleeping = max(0,src.sleeping-5) + if(src.sleeping == 0) + src.resting = 0 + M.visible_message("[M] shakes [src] trying to wake [T.him] up!", \ + "You shake [src] trying to wake [T.him] up!") + else + var/mob/living/carbon/human/hugger = M + var/datum/gender/TM = gender_datums[M.get_visible_gender()] + if(M.resting == 1) //Are they resting on the ground? + M.visible_message("[M] grabs onto [src] and pulls [TM.himself] up", \ + "You grip onto [src] and pull yourself up off the ground!") + if(M.fire_stacks >= (src.fire_stacks + 3)) //Fire checks. + src.adjust_fire_stacks(1) + M.adjust_fire_stacks(-1) + if(M.on_fire) + src.IgniteMob() + if(do_after(M, 0.5 SECONDS)) //.5 second delay. Makes it a bit stronger than just typing rest. + M.resting = 0 //Hoist yourself up up off the ground. No para/stunned/weakened removal. + else if(istype(hugger)) + hugger.species.hug(hugger,src) + else + M.visible_message("[M] hugs [src] to make [T.him] feel better!", \ + "You hug [src] to make [T.him] feel better!") + if(M.fire_stacks >= (src.fire_stacks + 3)) + src.adjust_fire_stacks(1) + M.adjust_fire_stacks(-1) + if(M.on_fire) + src.IgniteMob() + AdjustParalysis(-3) + AdjustStunned(-3) + AdjustWeakened(-3) + + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + +/mob/living/carbon/proc/eyecheck() + return 0 + +/mob/living/carbon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash) + if(eyecheck() < intensity || override_blindness_check) + return ..() + +// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching. +// Stop! ... Hammertime! ~Carn + +/mob/living/carbon/proc/getDNA() + return dna + +/mob/living/carbon/proc/setDNA(var/datum/dna/newDNA) + dna = newDNA + +// ++++ROCKDTBEN++++ MOB PROCS //END + +/mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) + ..() + var/temp_inc = max(min(BODYTEMP_HEATING_MAX*(1-get_heat_protection()), exposed_temperature - bodytemperature), 0) + bodytemperature += temp_inc + +/mob/living/carbon/can_use_hands() + if(handcuffed) + return 0 + if(buckled && istype(buckled, /obj/structure/bed/nest)) // buckling does not restrict hands + return 0 + return 1 + +/mob/living/carbon/restrained() + if (handcuffed) + return 1 + return + +/mob/living/carbon/u_equip(obj/item/W as obj) + if(!W) return 0 + + else if (W == handcuffed) + handcuffed = null + update_inv_handcuffed() + if(buckled && buckled.buckle_require_restraints) + buckled.unbuckle_mob() + + else if (W == legcuffed) + legcuffed = null + update_inv_legcuffed() + else + ..() + + return + +//generates realistic-ish pulse output based on preset levels +/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate + var/temp = 0 //see setup.dm:694 + switch(src.pulse) + if(PULSE_NONE) + return "0" + if(PULSE_SLOW) + temp = rand(40, 60) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_NORM) + temp = rand(60, 90) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_FAST) + temp = rand(90, 120) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_2FAST) + temp = rand(120, 160) + return num2text(method ? temp : temp + rand(-10, 10)) + if(PULSE_THREADY) + return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread" +// output for machines^ ^^^^^^^output for people^^^^^^^^^ + +/mob/living/carbon/verb/mob_sleep() + set name = "Sleep" + set category = "IC" + + if(usr.sleeping) + to_chat(usr, "You are already sleeping") + return + if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes") + usr.sleeping = 20 //Short nap + +/mob/living/carbon/Bump(atom/A) + if(now_pushing) + return + ..() + if(istype(A, /mob/living/carbon) && prob(10)) + spread_disease_to(A, "Contact") + +/mob/living/carbon/cannot_use_vents() + return + +/mob/living/carbon/slip(var/slipped_on,stun_duration=8) + if(buckled) + return 0 + stop_pulling() + to_chat(src, "You slipped on [slipped_on]!") + playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) + Weaken(FLOOR(stun_duration/2, 1)) + return 1 + +/mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1) + if(effect in chem_effects) + chem_effects[effect] += magnitude + else + chem_effects[effect] = magnitude + +/mob/living/carbon/get_default_language() + if(default_language) + if(can_speak(default_language)) + return default_language + else + return GLOB.all_languages[LANGUAGE_GIBBERISH] + + if(!species) + return null + + return species.default_language ? GLOB.all_languages[species.default_language] : null + +/mob/living/carbon/proc/should_have_organ(var/organ_check) + return 0 + +/mob/living/carbon/can_feel_pain(var/check_organ) + if(isSynthetic()) + return 0 + return !(species.flags & NO_PAIN) + +/mob/living/carbon/needs_to_breathe() + if(does_not_breathe) + return FALSE + return ..() +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index 77e0f0cbe9..4cd2c8bb03 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -81,4 +81,8 @@ cleaned_human.shoes.clean_blood() cleaned_human.update_inv_shoes(0) cleaned_human.clean_blood(1) - cleaned_human << "[src] cleans your face!" \ No newline at end of file +<<<<<<< HEAD + cleaned_human << "[src] cleans your face!" +======= + to_chat(cleaned_human, "[src] cleans your face!") +>>>>>>> 6571a10... Merge pull request #7052 from VOREStation/pol-moved