mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01:00
Lots of edits, needs review
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
var/no_spin_thrown = 0
|
||||
var/moved_recently = 0
|
||||
var/mob/pulledby = null
|
||||
var/atom/movable/pulling
|
||||
var/canmove = 1
|
||||
|
||||
var/inertia_dir = 0
|
||||
var/atom/inertia_last_loc
|
||||
@@ -58,6 +60,62 @@
|
||||
pulledby = null
|
||||
return ..()
|
||||
|
||||
/atom/movable/proc/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE)
|
||||
if(QDELETED(AM))
|
||||
return FALSE
|
||||
if(!(AM.can_be_pulled(src, state, force)))
|
||||
return FALSE
|
||||
|
||||
// If we're pulling something then drop what we're currently pulling and pull this instead.
|
||||
if(pulling)
|
||||
if(state == 0)
|
||||
stop_pulling()
|
||||
return FALSE
|
||||
// Are we trying to pull something we are already pulling? Then enter grab cycle and end.
|
||||
if(AM == pulling)
|
||||
if(istype(AM,/mob/living))
|
||||
var/mob/living/AMob = AM
|
||||
AMob.grabbedby(src)
|
||||
return TRUE
|
||||
stop_pulling()
|
||||
if(AM.pulledby)
|
||||
add_attack_logs(AM, AM.pulledby, "pulled from", src)
|
||||
AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once.
|
||||
pulling = AM
|
||||
AM.pulledby = src
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
add_attack_logs(src, M, "grabbed", addition="passive grab")
|
||||
if(!supress_message)
|
||||
visible_message("<span class='warning'>[src] has grabbed [M] passively!</span>")
|
||||
return TRUE
|
||||
|
||||
/atom/movable/proc/stop_pulling()
|
||||
if(pulling)
|
||||
pulling.pulledby = null
|
||||
var/mob/living/ex_pulled = pulling
|
||||
pulling = null
|
||||
if(isliving(ex_pulled))
|
||||
var/mob/living/L = ex_pulled
|
||||
L.update_canmove()// mob gets up if it was lyng down in a chokehold
|
||||
|
||||
/atom/movable/proc/check_pulling()
|
||||
if(pulling)
|
||||
var/atom/movable/pullee = pulling
|
||||
if(pullee && get_dist(src, pullee) > 1)
|
||||
stop_pulling()
|
||||
return
|
||||
if(!isturf(loc))
|
||||
stop_pulling()
|
||||
return
|
||||
if(pullee && !isturf(pullee.loc) && pullee.loc != loc) //to be removed once all code that changes an object's loc uses forceMove().
|
||||
log_game("DEBUG:[src]'s pull on [pullee] wasn't broken despite [pullee] being in [pullee.loc]. Pull stopped manually.")
|
||||
stop_pulling()
|
||||
return
|
||||
if(pulling.anchored)
|
||||
stop_pulling()
|
||||
return
|
||||
|
||||
/atom/movable/proc/can_be_pulled(user, grab_state, force)
|
||||
if(src == user || !isturf(loc))
|
||||
return FALSE
|
||||
@@ -232,7 +290,7 @@
|
||||
step(src, AM.dir)
|
||||
..()
|
||||
|
||||
/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, /datum/callback/callback, force = INFINITY)
|
||||
/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = INFINITY)
|
||||
if(!target || (flags & NODROP) || speed <= 0)
|
||||
return 0
|
||||
|
||||
@@ -341,15 +399,15 @@
|
||||
|
||||
/atom/movable/proc/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
return FALSE
|
||||
/atom/movable/proc/force_push(atom/movable/AM, force = move_force, direction, silent = FALSE)
|
||||
/atom/movable/proc/force_push(atom/movable/AM, force = move_force, direction, silent = FALSE)
|
||||
. = AM.force_pushed(src, force, direction)
|
||||
if(!silent && .)
|
||||
visible_message("<span class='warning'>[src] forcefully pushes against [AM]!</span>", "<span class='warning'>You forcefully push against [AM]!</span>")
|
||||
/atom/movable/proc/move_crush(atom/movable/AM, force = move_force, direction, silent = FALSE)
|
||||
/atom/movable/proc/move_crush(atom/movable/AM, force = move_force, direction, silent = FALSE)
|
||||
. = AM.move_crushed(src, force, direction)
|
||||
if(!silent && .)
|
||||
visible_message("<span class='danger'>[src] crushes past [AM]!</span>", "<span class='danger'>You crush [AM]!</span>")
|
||||
/atom/movable/proc/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
/atom/movable/proc/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
return FALSE
|
||||
|
||||
/atom/movable/CanPass(atom/movable/mover, turf/target, height=1.5)
|
||||
|
||||
@@ -154,7 +154,6 @@
|
||||
name = "odd blood"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "nothing"
|
||||
var/canmove = 1
|
||||
density = 0
|
||||
anchored = 1
|
||||
invisibility = 60
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
var/code = 0 // frequency code, they should be different unless you have a group of magnets working together or something
|
||||
var/turf/center // the center of magnetic attraction
|
||||
var/on = 0
|
||||
var/pulling = 0
|
||||
var/magpulling = 0
|
||||
|
||||
// x, y modifiers to the center turf; (0, 0) is centered on the magnet, whereas (1, -1) is one tile right, one tile down
|
||||
var/center_x = 0
|
||||
@@ -154,10 +154,10 @@
|
||||
|
||||
|
||||
/obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the pulling
|
||||
if(pulling) return
|
||||
if(magpulling) return
|
||||
while(on)
|
||||
|
||||
pulling = 1
|
||||
magpulling = 1
|
||||
center = locate(x+center_x, y+center_y, z)
|
||||
if(center)
|
||||
for(var/obj/M in orange(magnetic_field, center))
|
||||
@@ -171,7 +171,7 @@
|
||||
use_power(electricity_level * 5)
|
||||
sleep(13 - electricity_level)
|
||||
|
||||
pulling = 0
|
||||
magpulling = 0
|
||||
|
||||
/obj/machinery/magnetic_controller
|
||||
name = "Magnetic Control Console"
|
||||
|
||||
@@ -89,10 +89,10 @@
|
||||
|
||||
/obj/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
return TRUE
|
||||
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
collision_damage(pusher, force, direction)
|
||||
return TRUE
|
||||
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
var/amt = max(0, ((force - (move_resist * MOVE_FORCE_CRUSH_RATIO)) / (move_resist * MOVE_FORCE_CRUSH_RATIO)) * 10)
|
||||
take_damage(amt, BRUTE)
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@
|
||||
amount_grown = min(amount_grown + 1, max_grown)
|
||||
..(amount)
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/mob/living/carbon/alien/larva/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE)
|
||||
return
|
||||
|
||||
>>>>>>> Lots of edits, needs review
|
||||
/mob/living/carbon/alien/larva/ex_act(severity)
|
||||
..()
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
if(thrown_thing)
|
||||
visible_message("<span class='danger'>[src] has thrown [thrown_thing].</span>")
|
||||
newtonian_move(get_dir(target, src))
|
||||
thrown_thing.safe_throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed, src, null, null, null, move_force)
|
||||
thrown_thing.throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed, src, null, null, null, move_force)
|
||||
|
||||
/mob/living/carbon/can_use_hands()
|
||||
if(handcuffed)
|
||||
|
||||
@@ -134,8 +134,7 @@
|
||||
return TRUE
|
||||
if(!client && (mob_size < MOB_SIZE_SMALL))
|
||||
return
|
||||
if(!AM.anchored)
|
||||
now_pushing = TRUE
|
||||
now_pushing = TRUE
|
||||
var/t = get_dir(src, AM)
|
||||
var/push_anchored = FALSE
|
||||
if((AM.move_resist * MOVE_FORCE_CRUSH_RATIO) <= force)
|
||||
@@ -862,6 +861,51 @@ now_pushing = TRUE
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/start_pulling(atom/movable/AM, state, force = pull_force, supress_message = FALSE)
|
||||
if(src == AM) // Trying to pull yourself is a shortcut to stop pulling
|
||||
stop_pulling()
|
||||
return
|
||||
if(!AM || !isturf(AM.loc)) //if there's no object or the object being pulled is inside something: abort!
|
||||
return
|
||||
if(incapacitated())
|
||||
return
|
||||
if(!(AM.anchored))
|
||||
AM.add_fingerprint(src)
|
||||
|
||||
// If we're pulling something then drop what we're currently pulling and pull this instead.
|
||||
if(pulling)
|
||||
// Are we trying to pull something we are already pulling? Then just stop here, no need to continue.
|
||||
if(AM == pulling)
|
||||
return
|
||||
stop_pulling()
|
||||
if(AM.pulledby)
|
||||
visible_message("<span class='danger'>[src] has pulled [AM] from [AM.pulledby]'s grip.</span>")
|
||||
AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once.
|
||||
|
||||
pulling = AM
|
||||
AM.pulledby = src
|
||||
if(pullin)
|
||||
pullin.update_icon(src)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(!iscarbon(src))
|
||||
M.LAssailant = null
|
||||
else
|
||||
M.LAssailant = usr
|
||||
|
||||
/mob/living/verb/stop_pulling1()
|
||||
set name = "Stop Pulling"
|
||||
set category = "IC"
|
||||
if(pulling)
|
||||
pulling.pulledby = null
|
||||
pulling = null
|
||||
if(pullin)
|
||||
pullin.update_icon(src)
|
||||
|
||||
/mob/living/proc/check_pull()
|
||||
if(pulling && !(pulling in orange(1)))
|
||||
stop_pulling()
|
||||
|
||||
/mob/living/proc/get_taste_sensitivity()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
var/obj/machinery/machine = null
|
||||
var/other_mobs = null
|
||||
var/memory = ""
|
||||
var/atom/movable/pulling = null
|
||||
var/next_move = null
|
||||
var/notransform = null //Carbon
|
||||
var/other = 0.0
|
||||
@@ -48,7 +47,6 @@
|
||||
var/bhunger = 0 //Carbon
|
||||
var/lying = 0
|
||||
var/lying_prev = 0
|
||||
var/canmove = 1
|
||||
var/lastpuke = 0
|
||||
var/unacidable = 0
|
||||
var/can_strip = 1
|
||||
|
||||
+1
-1
@@ -326,6 +326,7 @@
|
||||
#include "code\datums\helper_datums\topic_input.dm"
|
||||
#include "code\datums\looping_sounds\looping_sound.dm"
|
||||
#include "code\datums\looping_sounds\machinery_sounds.dm"
|
||||
#include "code\datums\looping_sounds\thermal_drill.dm"
|
||||
#include "code\datums\looping_sounds\weather.dm"
|
||||
#include "code\datums\outfits\outfit.dm"
|
||||
#include "code\datums\outfits\outfit_admin.dm"
|
||||
@@ -1598,7 +1599,6 @@
|
||||
#include "code\modules\mob\mob_helpers.dm"
|
||||
#include "code\modules\mob\mob_movement.dm"
|
||||
#include "code\modules\mob\mob_transformation_simple.dm"
|
||||
#include "code\modules\mob\pulling.dm"
|
||||
#include "code\modules\mob\say.dm"
|
||||
#include "code\modules\mob\status_procs.dm"
|
||||
#include "code\modules\mob\transform_procs.dm"
|
||||
|
||||
Reference in New Issue
Block a user