Physics update (#11165)

* Makes space drift affect everything

* Kicking & Newton's 2nd law

* Mecha fix, special attack fix

* ix

* Check on_foot() for slips
This commit is contained in:
unid15
2016-08-07 21:53:30 +02:00
committed by clusterfack
parent c158bf2c6c
commit a8f825aeee
23 changed files with 193 additions and 258 deletions

View File

@@ -22,7 +22,6 @@
var/use_internal_tank = 0
var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature
var/datum/global_iterator/pr_give_air //moves air from tank to cabin
var/inertia_dir = 0
var/hatch_open = 0
var/next_firetime = 0
var/list/pod_overlays
@@ -430,7 +429,7 @@
. = ..()
if(dir && (oldloc != NewLoc))
src.loc.Entered(src, oldloc)
/obj/spacepod/proc/Process_Spacemove(var/check_drift = 0, mob/user)
/obj/spacepod/Process_Spacemove(var/check_drift = 0, mob/user)
var/dense_object = 0
if(!user)
for(var/direction in list(NORTH, NORTHEAST, EAST))
@@ -448,23 +447,11 @@
var/moveship = 1
if(battery && battery.charge >= 3 && health)
src.dir = direction
switch(direction)
if(1)
if(inertia_dir == 2)
inertia_dir = 0
moveship = 0
if(2)
if(inertia_dir == 1)
inertia_dir = 0
moveship = 0
if(4)
if(inertia_dir == 8)
inertia_dir = 0
moveship = 0
if(8)
if(inertia_dir == 4)
inertia_dir = 0
moveship = 0
if(inertia_dir == turn(direction, 180))
inertia_dir = 0
moveship = 0
if(moveship)
Move(get_step(src,direction), direction)
if(istype(src.loc, /turf/space))
@@ -481,6 +468,21 @@
return 0
battery.charge = max(0, battery.charge - 3)
/obj/spacepod/process_inertia(turf/start)
set waitfor = 0
if(Process_Spacemove(1))
inertia_dir = 0
return
sleep(5)
if(loc == start)
if(inertia_dir)
Move(get_step(src, inertia_dir), inertia_dir)
return
/obj/effect/landmark/spacepod/random //One of these will be chosen from across all Z levels to receive a pod in gameticker.dm
name = "spacepod spawner"
invisibility = 101

View File

@@ -14,14 +14,16 @@
return
if(a_intent == "hurt" && A.loc != src)
var/special_attack_result = SPECIAL_ATTACK_SUCCESS
switch(attack_type) //Special attacks - kicks, bites
if(ATTACK_KICK)
if(can_kick(A))
delayNextAttack(10)
if(!A.kick_act(src)) //kick_act returns 1 if the kick failed or couldn't be done
special_attack_result = A.kick_act(src)
if(special_attack_result != SPECIAL_ATTACK_CANCEL) //kick_act returns that value if there's no interaction specified
after_special_attack(A, attack_type, special_attack_result)
return
delayNextAttack(-10) //This is only called when the kick fails
@@ -33,7 +35,9 @@
delayNextAttack(10)
if(!A.bite_act(src)) //bite_act returns 1 if the bite failed or couldn't be done
special_attack_result = A.bite_act(src)
if(special_attack_result != SPECIAL_ATTACK_CANCEL) //bite_act returns that value if there's no interaction specified
after_special_attack(A, attack_type, special_attack_result)
return
delayNextAttack(-10) //This is only called when the bite fails

View File

@@ -42,6 +42,7 @@
// Can we send relaymove() if gravity is disabled or we are in space? (Should be handled by relaymove, but shitcode abounds)
var/internal_gravity = 0
var/inertia_dir = null
/atom/movable/New()
. = ..()
@@ -150,24 +151,24 @@
if (!(Dir & (Dir - 1))) //Cardinal move
. = ..()
else //Diagonal move, split it into cardinal moves
if (Dir & 1)
if (Dir & 4)
if (Dir & NORTH)
if (Dir & EAST) //Northeast
if (step(src, NORTH))
. = step(src, EAST)
else if (step(src, EAST))
. = step(src, NORTH)
else if (Dir & 8)
else if (Dir & WEST) //Northwest
if (step(src, NORTH))
. = step(src, WEST)
else if (step(src, WEST))
. = step(src, NORTH)
else if (Dir & 2)
if (Dir & 4)
else if (Dir & SOUTH)
if (Dir & EAST) //Southeast
if (step(src, SOUTH))
. = step(src, EAST)
else if (step(src, EAST))
. = step(src, SOUTH)
else if (Dir & 8)
else if (Dir & WEST) //Southwest
if (step(src, SOUTH))
. = step(src, WEST)
else if (step(src, WEST))
@@ -195,7 +196,7 @@
tether_datum.snap = 1
tether_datum.Delete_Chain()
last_move = Dir
last_move = (Dir || get_dir(oldloc, newLoc)) //If direction isn't specified, calculate it ourselves
last_moved = world.time
src.move_speed = world.timeofday - src.l_move_time
src.l_move_time = world.timeofday
@@ -443,7 +444,7 @@
. = 0
break
src.Move(step)
src.Move(step, dy)
. = hit_check(speed, user)
error += dist_x
dist_travelled++
@@ -457,7 +458,7 @@
. = 0
break
src.Move(step)
src.Move(step, dx)
. = hit_check(speed, user)
error -= dist_y
dist_travelled++
@@ -479,7 +480,7 @@
. = 0
break
src.Move(step)
src.Move(step, dx)
. = hit_check(speed, user)
error += dist_y
dist_travelled++
@@ -493,7 +494,7 @@
. = 0
break
src.Move(step)
src.Move(step, dy)
. = hit_check(speed, user)
error -= dist_x
dist_travelled++
@@ -575,3 +576,67 @@
//Can it be moved by a shuttle?
/atom/movable/proc/can_shuttle_move(var/datum/shuttle/S)
return 1
/atom/movable/proc/Process_Spacemove(check_drift)
var/dense_object = 0
for(var/turf/turf in oview(1,src))
if(!turf.has_gravity(src))
continue
dense_object++
break
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src)))
dense_object++
if(!dense_object && (locate(/obj/structure/catwalk) in oview(1, src)))
dense_object++
if(!dense_object && (locate(/obj/effect/blob) in oview(1, src)))
dense_object++
//Lastly attempt to locate any dense objects we could push off of
//TODO: If we implement objects drifing in space this needs to really push them
//Due to a few issues only anchored and dense objects will now work.
if(!dense_object)
for(var/obj/O in oview(1, src))
if((O) && (O.density) && (O.anchored))
dense_object++
break
//Nothing to push off of so end here
if(!dense_object)
return 0
//If not then we can reset inertia and move
inertia_dir = 0
return 1
//INERTIA
/atom/movable/proc/apply_inertia(direction)
if(isturf(loc))
var/turf/T = loc
if(!T.has_gravity())
src.inertia_dir = direction
step(src, src.inertia_dir)
return 1
else if(istype(loc, /atom/movable))
var/atom/movable/AM = loc
return AM.apply_inertia(direction)
/atom/movable/proc/process_inertia(turf/start)
set waitfor = 0
if(Process_Spacemove(1))
inertia_dir = 0
return
sleep(5)
if(can_apply_inertia() && (src.loc == start))
if(!inertia_dir)
inertia_dir = last_move
step(src, inertia_dir)
/atom/movable/proc/can_apply_inertia()
return (!src.anchored && !(src.pulledby && src.pulledby.Adjacent(src)))

View File

@@ -485,3 +485,4 @@ var/list/camera_names=list()
to_chat(H, "<span class='danger'>Dumb move! You strain a muscle.</span>")
H.apply_damage(rand(1,2), BRUTE, pick(LIMB_RIGHT_LEG, LIMB_LEFT_LEG, LIMB_RIGHT_FOOT, LIMB_LEFT_FOOT))
return SPECIAL_ATTACK_FAILED

View File

@@ -112,6 +112,9 @@
..()
return
/obj/mecha/can_apply_inertia()
return 1 //No anchored check - so that mechas can fly off into space
/obj/mecha/is_airtight()
return !use_internal_tank
////////////////////////

View File

@@ -144,7 +144,7 @@ steam.start() -- spawns the effect
icon_state = "sparks"
anchored = 1
var/inertia_dir = 0
var/move_dir = 0
var/energy = 0
/obj/effect/effect/sparks/New(var/travel_dir)
@@ -154,7 +154,7 @@ steam.start() -- spawns the effect
T.hotspot_expose(1000, 100, surfaces = 1)
/obj/effect/effect/sparks/proc/start(var/travel_dir, var/max_energy=3)
inertia_dir=travel_dir
move_dir=travel_dir
energy=rand(1,max_energy)
processing_objects.Add(src)
var/turf/T = loc
@@ -183,7 +183,7 @@ steam.start() -- spawns the effect
returnToPool(src)
return
else
step(src,inertia_dir)
step(src,move_dir)
energy--
/datum/effect/effect/system/spark_spread/set_up(var/n = 3, var/use_cardinals = 0, loca)

View File

@@ -293,6 +293,7 @@ var/global/list/available_paintings = list(
to_chat(H, "<span class='danger'>Dumb move! You strain a muscle.</span>")
H.apply_damage(rand(1,2), BRUTE, pick(LIMB_RIGHT_LEG, LIMB_LEFT_LEG, LIMB_RIGHT_FOOT, LIMB_LEFT_FOOT))
return SPECIAL_ATTACK_FAILED
/obj/structure/painting/cultify()

View File

@@ -175,14 +175,13 @@
sleep(3)
B.Move(get_step(user,movementdirection), movementdirection)
if(locate(/obj) in src)
for(var/obj/thing in src)
thing.loc = get_turf(src)
thing.throw_at(target,10,thing.throw_speed*3)
user.visible_message(
"<span class='danger'>[user] fires [src] and launches [thing] at [target]!</span>",
"<span class='danger'>You fire [src] and launch [thing] at [target]!</span>")
break
for(var/obj/thing in src)
thing.forceMove(get_turf(src))
thing.throw_at(target,10,thing.throw_speed*3)
user.visible_message(
"<span class='danger'>[user] fires [src] and launches [thing] at [target]!</span>",
"<span class='danger'>You fire [src] and launch [thing] at [target]!</span>")
break
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
@@ -227,9 +226,7 @@
if(W.loc == my_target) break
sleep(2)
if((istype(user.loc, /turf/space)) || (user.areaMaster.has_gravity == 0))
user.inertia_dir = get_dir(target, user)
step(user, user.inertia_dir)
user.apply_inertia(get_dir(target, user))
else
return ..()
return
@@ -324,9 +321,7 @@
if(W.loc == my_target) break
sleep(2)
if((istype(user.loc, /turf/space)) || (user.areaMaster.has_gravity == 0))
user.inertia_dir = get_dir(target, user)
step(user, user.inertia_dir)
user.apply_inertia(get_dir(target, user))
else
return ..()
return

View File

@@ -28,7 +28,7 @@
var/health = 100
var/max_health = 100
var/destroyed = 0
var/inertia_dir = 0
plane = ABOVE_HUMAN_PLANE
layer = VEHICLE_LAYER
@@ -50,6 +50,9 @@
/obj/structure/bed/chair/vehicle/proc/delayNextMove(var/delay, var/additive=0)
move_delayer.delayNext(delay,additive)
/obj/structure/bed/chair/vehicle/can_apply_inertia()
return 1 //No anchored check - so that vehicles can fly off into space
/obj/structure/bed/chair/vehicle/New()
..()
processing_objects |= src
@@ -106,8 +109,8 @@
return 0
//If we're in space or our area has no gravity...
if(istype(get_turf(src), /turf/space) || (areaMaster && areaMaster.has_gravity == 0))
var/turf/T = loc
if(!T.has_gravity())
// Block relaymove() if needed.
if(!Process_Spacemove(0))
return 0
@@ -120,7 +123,6 @@
var/datum/chain/tether_datum = user.tether.chain_datum
tether_datum.snap = 1
tether_datum.Delete_Chain()
var/turf/T = loc
step(src, direction)
delayNextMove(getMovementDelay())
@@ -141,79 +143,6 @@
var/turf/space/S = src.loc
S.Entered(src)*/
/obj/structure/bed/chair/vehicle/proc/Process_Spacemove(var/check_drift = 0, mob/user)
if(can_spacemove && occupant)
return 1
var/dense_object = 0
if(!user)
for(var/turf/turf in oview(1, src))
if(istype(turf, /turf/space))
continue
if(istype(turf, /turf/simulated/floor) && (src.areaMaster && src.areaMaster.has_gravity == 0)) //No gravity
continue
dense_object++
break
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src)))
dense_object++
if(!dense_object && (locate(/obj/structure/catwalk) in oview(1, src)))
dense_object++
//Lastly attempt to locate any dense objects we could push off of
//TODO: If we implement objects drifing in space this needs to really push them
//Due to a few issues only anchored and dense objects will now work.
if(!dense_object)
for(var/obj/O in oview(1, src))
if((O) && (O.density) && (O.anchored))
dense_object++
break
else
for(var/turf/turf in oview(1, user))
if(istype(turf, /turf/space))
continue
if(istype(turf, /turf/simulated/floor) && (src.areaMaster && src.areaMaster.has_gravity == 0)) //No gravity
continue
dense_object++
break
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, user)))
dense_object++
if(!dense_object && (locate(/obj/structure/catwalk) in oview(1, src)))
dense_object++
//Lastly attempt to locate any dense objects we could push off of
//TODO: If we implement objects drifing in space this needs to really push them
//Due to a few issues only anchored and dense objects will now work.
if(!dense_object)
for(var/obj/O in oview(1, user))
if((O) && (O.density) && (O.anchored))
dense_object++
break
//Nothing to push off of so end here
if(!dense_object)
return 0
//Check to see if we slipped
if(prob(5))
to_chat(src, "<span class='bnotice'>You slipped!</span>")
src.inertia_dir = src.last_move
step(src, src.inertia_dir)
return 0
//If not then we can reset inertia and move
inertia_dir = 0
return 1
/obj/structure/bed/chair/vehicle/proc/can_buckle(mob/M, mob/user)
if(M != user || !ishuman(user) || !Adjacent(user) || user.restrained() || user.lying || user.stat || user.locked_to || destroyed || occupant)
return 0

View File

@@ -52,12 +52,6 @@
return 1
return BUILD_FAILURE
// Ported from unstable r355
/turf/space/Entered(atom/movable/A as mob|obj)
..()
inertial_drift(A)
/turf/space/proc/Sandbox_Spacemove(atom/movable/A as mob|obj)
var/cur_x
var/cur_y
@@ -182,4 +176,7 @@
desc = "The final final frontier."
/turf/space/void/New()
return
return
/turf/space/has_gravity()
return 0

View File

@@ -130,16 +130,12 @@
return
//THIS IS OLD TURF ENTERED CODE
var/loopsanity = 100
if(ismob(A))
if(A.areaMaster && A.areaMaster.has_gravity == 0)
inertial_drift(A)
/*
if(A.flags & NOGRAV)
inertial_drift(A)
*/
else if(!istype(src, /turf/space))
A:inertia_dir = 0
if(!src.has_gravity())
inertial_drift(A)
else
A.inertia_dir = 0
..()
var/objects = 0
if(A && A.flags & PROXMOVE)
@@ -257,43 +253,10 @@
/turf/proc/inertial_drift(atom/movable/A as mob|obj)
if(!(A.last_move)) return
if(istype(A, /obj/spacepod) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1))
var/obj/spacepod/SP = A
if(SP.Process_Spacemove(1))
SP.inertia_dir = 0
return
spawn(5)
if((SP && (SP.loc == src)))
if(SP.inertia_dir)
SP.Move(get_step(SP, SP.inertia_dir), SP.inertia_dir)
return
if(istype(A, /obj/structure/bed/chair/vehicle/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1))
var/obj/structure/bed/chair/vehicle/JC = A //A bomb!
if(JC.Process_Spacemove(1))
JC.inertia_dir = 0
return
spawn(5)
if((JC && (JC.loc == src)))
if(JC.inertia_dir)
step(JC, JC.inertia_dir)
return
JC.inertia_dir = JC.last_move
step(JC, JC.inertia_dir)
if((istype(A, /mob/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1)))
var/mob/M = A
if(M.Process_Spacemove(1))
M.inertia_dir = 0
return
spawn(5)
if((M && !(M.anchored) && !(M.pulledby) && (M.loc == src)))
var/mob/living/carbon/carbons = M
if(istype(carbons))
carbons.update_minimap() //Should this even be here, oh well whatever
if(M.inertia_dir)
step(M, M.inertia_dir)
return
M.inertia_dir = M.last_move
step(M, M.inertia_dir)
if(src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy - 1))
A.process_inertia(src)
return
/turf/proc/levelupdate()
@@ -705,3 +668,13 @@
// Return high values to make movement slower
/turf/proc/adjust_slowdown(mob/living/L, base_slowdown)
return base_slowdown
/turf/proc/has_gravity(mob/M)
if(istype(M) && M.CheckSlip() == -1) //Wearing magboots - good enough
return 1
var/area/A = loc
if(istype(A))
return A.has_gravity
return 1

View File

@@ -57,6 +57,7 @@
S.Crossed()
qdel(src)
return SPECIAL_ATTACK_FAILED
/obj/item/clothing/glasses/regular/hipster
name = "Prescription Glasses"
@@ -88,6 +89,7 @@
S.Crossed()
qdel(src)
return SPECIAL_ATTACK_FAILED
/obj/item/clothing/glasses/sunglasses/purple
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes, and the colored lenses let you see the world in purple."

View File

@@ -352,16 +352,7 @@
src.visible_message("<span class='warning'>[src] has thrown [item].</span>", \
drugged_message = "<span class='warning'>[item] escapes from [src]'s grasp and flies away!</span>")
if((istype(src.loc, /turf/space)) || (src.areaMaster && (src.areaMaster.has_gravity == 0)))
var/mob/space_obj=src
// If we're being held, make the guy holding us move.
if(istype(loc,/obj/item/weapon/holder))
var/obj/item/weapon/holder/Ho=loc
// Who holds the holder?
if(ismob(Ho.loc))
space_obj=Ho.loc
space_obj.inertia_dir = get_dir(target, src)
step(space_obj, inertia_dir)
src.apply_inertia(get_dir(target, src))
/*

View File

@@ -1635,6 +1635,12 @@
return 0
/mob/living/carbon/human/proc/after_special_attack(atom/target, attack_type, attack_result)
switch(attack_type)
if(ATTACK_KICK)
if(attack_result != SPECIAL_ATTACK_FAILED) //The kick landed successfully
apply_inertia(get_dir(target, src))
/mob/living/carbon/human/proc/get_footprint_type()
var/obj/item/clothing/shoes/S = shoes //Why isn't shoes just typecast in the first place?
return ((istype(S) && S.footprint_type) || (species && species.footprint_type) || /obj/effect/decal/cleanable/blood/tracks/footprints) //The shoes' footprint type overrides the mob's, for obvious reasons. Shoes with a falsy footprint_type will let the mob's footprint take over, though.

View File

@@ -81,11 +81,6 @@
//Can we act
if(restrained()) return 0
//Are we flying?
if(flying)
inertia_dir = 0
return 1
//Do we have a working jetpack
if(istype(back, /obj/item/weapon/tank/jetpack))
var/obj/item/weapon/tank/jetpack/J = back
@@ -96,8 +91,7 @@
// return 1
//If no working jetpack then use the other checks
if(..()) return 1
return 0
return ..()
/mob/living/carbon/human/Process_Spaceslipping(var/prob_slip = 5)

View File

@@ -47,7 +47,7 @@
owner = L
/mob/living/simple_animal/hostile/scarybat/Process_Spacemove(var/check_drift = 0)
return ..() //No drifting in space for space carp! //original comments do not steal
return 1
/mob/living/simple_animal/hostile/scarybat/CanAttack(var/atom/the_target)
if(the_target == owner)

View File

@@ -78,7 +78,7 @@
speed = 0
/mob/living/simple_animal/hostile/humanoid/syndicate/melee/space/Process_Spacemove(var/check_drift = 0)
return
return 1
/mob/living/simple_animal/hostile/humanoid/syndicate/ranged
ranged = 1
@@ -98,7 +98,7 @@
projectiletype = /obj/item/projectile/beam
items_to_drop = list(/obj/item/weapon/gun/energy/laser)
/mob/living/simple_animal/hostile/humanoid/syndicate/ranged/space
icon_state = "syndicaterangedpsace"
icon_living = "syndicaterangedpsace"
@@ -116,4 +116,4 @@
speed = 0
/mob/living/simple_animal/hostile/humanoid/syndicate/ranged/space/Process_Spacemove(var/check_drift = 0)
return
return 1

View File

@@ -171,8 +171,6 @@
var/coughedtime = null
var/inertia_dir = 0
var/job = null//Living
var/datum/dna/dna = null//Carbon

View File

@@ -287,7 +287,8 @@
// if(!mob.Process_Spacemove(0)) return 0
// If we're in space or our area has no gravity...
if(istype(mob.loc, /turf/space) || (mob.areaMaster && mob.areaMaster.has_gravity == 0))
var/turf/turf_loc = mob.loc
if(istype(turf_loc) && !turf_loc.has_gravity())
var/can_move_without_gravity = 0
// Here, we check to see if the object we're in doesn't need gravity to send relaymove().
@@ -503,61 +504,22 @@
///Called by /client/Move()
///For moving in space
///Return 1 for movement 0 for none
/mob/proc/Process_Spacemove(var/check_drift = 0,var/ignore_slip = 0)
/mob/Process_Spacemove(var/check_drift = 0,var/ignore_slip = 0)
//First check to see if we can do things
if(restrained())
return 0
if(flying)
inertia_dir = 0
return 1
/*
if(istype(src,/mob/living/carbon))
if(src.l_hand && src.r_hand)
if(..())
//Check to see if we slipped
if(!ignore_slip && on_foot() && prob(Process_Spaceslipping(5)))
to_chat(src, "<span class='notice'><B>You slipped!</B></span>")
src.inertia_dir = src.last_move
step(src, src.inertia_dir)
return 0
*/
var/dense_object = 0
for(var/turf/turf in oview(1,src))
if(istype(turf,/turf/space))
continue
var/mob/living/carbon/human/H = src
if(istype(turf,/turf/simulated/floor) && (src.areaMaster && src.areaMaster.has_gravity == 0) && !(istype(H) && istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP)))
continue
dense_object++
break
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src)))
dense_object++
if(!dense_object && (locate(/obj/structure/catwalk) in oview(1, src)))
dense_object++
if(!dense_object && (locate(/obj/effect/blob) in oview(1, src)))
dense_object++
//Lastly attempt to locate any dense objects we could push off of
//TODO: If we implement objects drifing in space this needs to really push them
//Due to a few issues only anchored and dense objects will now work.
if(!dense_object)
for(var/obj/O in oview(1, src))
if((O) && (O.density) && (O.anchored))
dense_object++
break
//Nothing to push off of so end here
if(!dense_object)
return 0
//Check to see if we slipped
if(!ignore_slip && prob(Process_Spaceslipping(5)))
to_chat(src, "<span class='notice'><B>You slipped!</B></span>")
src.inertia_dir = src.last_move
step(src, src.inertia_dir)
return 0
//If not then we can reset inertia and move
inertia_dir = 0
return 1
return 1
/mob/proc/Process_Spaceslipping(var/prob_slip = 5)
//Setup slipage

View File

@@ -85,6 +85,7 @@
to_chat(H, "<span class='danger'>Dumb move! You strain a muscle.</span>")
H.apply_damage(rand(1,2), BRUTE, pick(LIMB_RIGHT_LEG, LIMB_LEFT_LEG, LIMB_RIGHT_FOOT, LIMB_LEFT_FOOT))
return SPECIAL_ATTACK_FAILED
/obj/machinery/light_construct/small
@@ -160,7 +161,7 @@ var/global/list/obj/machinery/light/alllights = list()
to_chat(H, "<span class='danger'>Dumb move! You strain a muscle.</span>")
H.apply_damage(rand(1,2), BRUTE, pick(LIMB_RIGHT_LEG, LIMB_LEFT_LEG, LIMB_RIGHT_FOOT, LIMB_LEFT_FOOT))
return SPECIAL_ATTACK_FAILED
/obj/machinery/light/small
icon_state = "lbulb1"

View File

@@ -194,9 +194,8 @@
B.Move(get_step(user,movementdirection), movementdirection)
sleep(3)
B.Move(get_step(user,movementdirection), movementdirection)
if((istype(user.loc, /turf/space)) || (user.areaMaster.has_gravity == 0))
user.inertia_dir = get_dir(target, user)
step(user, user.inertia_dir)
user.apply_inertia(get_dir(target, user))
if(silenced)
if(fire_sound)

View File

@@ -1791,6 +1791,11 @@ var/proccalls = 1
#define ATTACK_BITE 1
#define ATTACK_KICK 2
//Special attack returns (for procs like kick_act and bite_act)
#define SPECIAL_ATTACK_SUCCESS 0
#define SPECIAL_ATTACK_CANCEL 1 //Default return for the procs; cancel the special attack and perform a normal click instead
#define SPECIAL_ATTACK_FAILED 2
// Defines for the map writer, moved here for reasons.
#define DMM_IGNORE_AREAS 1
#define DMM_IGNORE_TURFS 2

View File

@@ -0,0 +1,7 @@
author: Unid
delete-after: True
changes:
- rscadd: All objects are now subject to space drift, including vehicles. This means crates, lockers and janicarts will now fly off into space, instead of immediately stopping moving.
- rscadd: Kicking something while in zero gravity will propel you in the opposite direction.