mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
Merge remote-tracking branch 'origin/bucklieng' into muh_tg_spessmove
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
phaseanim.master = user
|
||||
user.ExtinguishMob()
|
||||
if(user.buckled)
|
||||
user.buckled.unbuckle()
|
||||
user.buckled.unbuckle_mob()
|
||||
user.loc = holder
|
||||
flick("chronophase", phaseanim)
|
||||
spawn(7)
|
||||
|
||||
@@ -67,18 +67,17 @@
|
||||
var/last_tick = 0
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/plant
|
||||
|
||||
var/mob/living/buckled_mob = null
|
||||
var/movable = 0
|
||||
|
||||
/obj/effect/plant/Destroy()
|
||||
if(buckled_mob)
|
||||
unbuckle()
|
||||
unbuckle_mob()
|
||||
if(plant_controller)
|
||||
plant_controller.remove_plant(src)
|
||||
for(var/obj/effect/plant/neighbor in range(1,src))
|
||||
plant_controller.add_plant(neighbor)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/effect/plant/single
|
||||
spread_chance = 0
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/obj/effect/plant/attack_hand(mob/user as mob)
|
||||
// Todo, cause damage.
|
||||
manual_unbuckle(user)
|
||||
user_unbuckle_mob(user, user)
|
||||
|
||||
/obj/effect/plant/proc/trodden_on(var/mob/living/victim)
|
||||
if(!is_mature())
|
||||
@@ -26,37 +26,6 @@
|
||||
seed.do_thorns(victim,src)
|
||||
seed.do_sting(victim,src,pick("r_foot","l_foot","r_leg","l_leg"))
|
||||
|
||||
/obj/effect/plant/proc/unbuckle()
|
||||
if(buckled_mob)
|
||||
if(buckled_mob.buckled == src)
|
||||
buckled_mob.buckled = null
|
||||
buckled_mob.anchored = initial(buckled_mob.anchored)
|
||||
buckled_mob.update_canmove()
|
||||
buckled_mob = null
|
||||
return
|
||||
|
||||
/obj/effect/plant/proc/manual_unbuckle(mob/user as mob)
|
||||
if(buckled_mob)
|
||||
if(prob(seed ? min(max(0,100 - seed.get_trait(TRAIT_POTENCY)/2),100) : 50))
|
||||
if(buckled_mob.buckled == src)
|
||||
if(buckled_mob != user)
|
||||
buckled_mob.visible_message(\
|
||||
"<span class='notice'>[user.name] frees [buckled_mob.name] from \the [src].</span>",\
|
||||
"<span class='notice'>[user.name] frees you from \the [src].</span>",\
|
||||
"<span class='warning'>You hear shredding and ripping.</span>")
|
||||
else
|
||||
buckled_mob.visible_message(\
|
||||
"<span class='notice'>[buckled_mob.name] struggles free of \the [src].</span>",\
|
||||
"<span class='notice'>You untangle \the [src] from around yourself.</span>",\
|
||||
"<span class='warning'>You hear shredding and ripping.</span>")
|
||||
unbuckle()
|
||||
else
|
||||
var/text = pick("rip","tear","pull")
|
||||
user.visible_message(\
|
||||
"<span class='notice'>[user.name] [text]s at \the [src].</span>",\
|
||||
"<span class='notice'>You [text] at \the [src].</span>",\
|
||||
"<span class='warning'>You hear shredding and ripping.</span>")
|
||||
return
|
||||
|
||||
/obj/effect/plant/proc/entangle(var/mob/living/victim)
|
||||
|
||||
@@ -79,7 +48,6 @@
|
||||
|
||||
//entangling people
|
||||
if(victim.loc == src.loc)
|
||||
victim.buckled = src
|
||||
victim.update_canmove()
|
||||
buckled_mob = victim
|
||||
victim << "<span class='danger'>Tendrils [pick("wind", "tangle", "tighten")] around you!</span>"
|
||||
can_buckle = 1
|
||||
buckle_mob(victim)
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
src.ExtinguishMob()
|
||||
if(src.buckled)
|
||||
src.buckled.unbuckle()
|
||||
src.buckled.unbuckle_mob()
|
||||
if(src.pulling && src.bloodcrawl == BLOODCRAWL_EAT)
|
||||
if(istype(src.pulling, /mob/living/))
|
||||
var/mob/living/victim = src.pulling
|
||||
|
||||
@@ -529,6 +529,8 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
update_inv_wear_mask(0)
|
||||
else if(I == handcuffed)
|
||||
handcuffed = null
|
||||
if(buckled && buckled.buckle_requires_restraints)
|
||||
buckled.unbuckle_mob()
|
||||
update_inv_handcuffed(1)
|
||||
else if(I == legcuffed)
|
||||
legcuffed = null
|
||||
@@ -677,6 +679,9 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
/mob/living/carbon/proc/canBeHandcuffed()
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/fall(forced)
|
||||
loc.handle_fall(src, forced)//it's loc so it doesn't call the mob's handle_fall which does nothing
|
||||
|
||||
/mob/living/carbon/is_muzzled()
|
||||
return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
|
||||
@@ -686,7 +691,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
return -6
|
||||
else
|
||||
return initial(pixel_y)
|
||||
|
||||
|
||||
/mob/living/carbon/get_all_slots()
|
||||
return list(l_hand,
|
||||
r_hand,
|
||||
|
||||
@@ -396,23 +396,4 @@ This function restores all organs.
|
||||
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
|
||||
updatehealth()
|
||||
hud_updateflag |= 1 << HEALTH_HUD
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
// incredibly important stuff follows
|
||||
/mob/living/carbon/human/fall(var/forced)
|
||||
..()
|
||||
if(forced)
|
||||
playsound(loc, "bodyfall", 50, 1, -1)
|
||||
/* if(head)
|
||||
var/multiplier = 1
|
||||
if(stat || (status_flags & FAKEDEATH))
|
||||
multiplier = 2
|
||||
var/obj/item/clothing/head/H = head
|
||||
if(!istype(H) || prob(H.loose * multiplier))
|
||||
unEquip(H)
|
||||
if(prob(60))
|
||||
step_rand(H)
|
||||
if(!stat)
|
||||
src << "<span class='warning'>Your [H] fell off!</span>" */
|
||||
return 1
|
||||
@@ -193,7 +193,7 @@ emp_act
|
||||
var/turf/picked = pick(turfs)
|
||||
if(!isturf(picked)) return
|
||||
if(buckled)
|
||||
buckled.unbuckle()
|
||||
buckled.unbuckle_mob()
|
||||
src.loc = picked
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -400,8 +400,11 @@
|
||||
return
|
||||
|
||||
/mob/living/Move(a, b, flag)
|
||||
if (buckled)
|
||||
return
|
||||
if (buckled && buckled.loc != a)
|
||||
if (!buckled.anchored)
|
||||
return buckled.Move(a, b)
|
||||
else
|
||||
return 0
|
||||
|
||||
if (restrained())
|
||||
stop_pulling()
|
||||
@@ -639,10 +642,10 @@
|
||||
for(var/mob/O in viewers(C))
|
||||
O.show_message("\red <B>[usr] manages to unbuckle themself!</B>", 1)
|
||||
C << "\blue You successfully unbuckle yourself."
|
||||
C.buckled.manual_unbuckle(C)
|
||||
C.buckled.user_unbuckle_mob(C,C)
|
||||
|
||||
else
|
||||
L.buckled.manual_unbuckle(L)
|
||||
L.buckled.user_unbuckle_mob(L,L)
|
||||
|
||||
/* resist_closet() allows a mob to break out of a welded/locked closet
|
||||
*/////
|
||||
@@ -779,6 +782,8 @@
|
||||
CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
|
||||
qdel(CM.handcuffed)
|
||||
CM.handcuffed = null
|
||||
if(CM.buckled && CM.buckled.buckle_requires_restraints)
|
||||
CM.buckled.unbuckle_mob()
|
||||
CM.update_inv_handcuffed()
|
||||
return
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/absorb_text = null, var/soften_text = null, armour_penetration, penetrated_text)
|
||||
var/armor = getarmor(def_zone, attack_flag)
|
||||
|
||||
|
||||
//the if "armor" check is because this is used for everything on /living, including humans
|
||||
if(armor && armor < 100 && armour_penetration) // Armor with 100+ protection can not be penetrated for admin items
|
||||
armor = max(0, armor - armour_penetration)
|
||||
@@ -368,3 +368,7 @@
|
||||
else*///This is an example of how you can make special types of grabs simply based on direction.
|
||||
if(!supress_message)
|
||||
visible_message("<span class='warning'>[user] has grabbed [src] passively!</span>")
|
||||
|
||||
/mob/living/incapacitated()
|
||||
if(stat || paralysis || stunned || weakened || restrained())
|
||||
return 1
|
||||
|
||||
+18
-62
@@ -135,6 +135,9 @@
|
||||
/mob/proc/restrained()
|
||||
return
|
||||
|
||||
/mob/proc/incapacitated()
|
||||
return
|
||||
|
||||
//This proc is called whenever someone clicks an inventory ui slot.
|
||||
/mob/proc/attack_ui(slot)
|
||||
var/obj/item/W = get_active_hand()
|
||||
@@ -989,76 +992,29 @@ var/list/slot_equipment_priority = list( \
|
||||
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
|
||||
/mob/proc/update_canmove()
|
||||
var/ko = weakened || paralysis || stat || (status_flags & FAKEDEATH)
|
||||
if(ko || resting || buckled)
|
||||
canmove = 0
|
||||
if(!lying)
|
||||
if(resting) //Presuming that you're resting on a bed, which would look goofy lying the wrong way
|
||||
lying = 90
|
||||
else
|
||||
lying = pick(90, 270) //180 looks like shit since BYOND inverts rather than turns in that case
|
||||
else if(stunned)
|
||||
drop_l_hand()
|
||||
var/buckle_lying = !(buckled && !buckled.buckle_lying)
|
||||
if(ko || resting || stunned)
|
||||
drop_r_hand()
|
||||
canmove = 0
|
||||
drop_l_hand()
|
||||
else
|
||||
lying = 0
|
||||
canmove = 1
|
||||
var/is_movable
|
||||
if(buckled && istype(buckled))
|
||||
is_movable = buckled.movable
|
||||
|
||||
if(istype(buckled, /obj/vehicle))
|
||||
var/obj/vehicle/V = buckled
|
||||
if(stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH))
|
||||
lying = 90
|
||||
canmove = 0
|
||||
pixel_y = V.mob_offset_y - 5
|
||||
else
|
||||
lying = 0
|
||||
canmove = 1
|
||||
pixel_y = V.mob_offset_y
|
||||
else if(buckled && (!buckled.movable))
|
||||
anchored = 1
|
||||
canmove = 0
|
||||
if( istype(buckled,/obj/structure/stool/bed/chair) )
|
||||
lying = 0
|
||||
else
|
||||
lying = 90
|
||||
else if(buckled && is_movable)
|
||||
anchored = 0
|
||||
canmove = 1
|
||||
lying = 0
|
||||
else if( stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH))
|
||||
lying = 90
|
||||
canmove = 0
|
||||
else if( stunned )
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
canmove = 0
|
||||
if(buckled)
|
||||
lying = 90 * buckle_lying
|
||||
else
|
||||
lying = 0
|
||||
canmove = 1
|
||||
|
||||
if(lying)
|
||||
density = 0
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
else
|
||||
density = 1
|
||||
|
||||
//Temporarily moved here from the various life() procs
|
||||
//I'm fixing stuff incrementally so this will likely find a better home.
|
||||
//It just makes sense for now. ~Carn
|
||||
|
||||
if(lying != lying_prev)
|
||||
if(lying && !lying_prev)
|
||||
if((ko || resting) && !lying)
|
||||
fall(ko)
|
||||
|
||||
if(update_icon) //forces a full overlay update
|
||||
update_icon = 0
|
||||
regenerate_icons()
|
||||
canmove = !(ko || resting || stunned || buckled)
|
||||
density = !lying
|
||||
if(lying)
|
||||
if(layer == initial(layer))
|
||||
layer = MOB_LAYER - 0.2
|
||||
else
|
||||
if(layer == MOB_LAYER - 0.2)
|
||||
layer = initial(layer)
|
||||
|
||||
update_transform()
|
||||
lying_prev = lying
|
||||
return canmove
|
||||
|
||||
/mob/proc/fall(var/forced)
|
||||
|
||||
@@ -225,13 +225,15 @@
|
||||
|
||||
if(Process_Grab()) return
|
||||
|
||||
if(mob.buckled) //if we're buckled to something, tell it we moved.
|
||||
return mob.buckled.relaymove(mob, direct)
|
||||
|
||||
if(mob.remote_control) //we're controlling something, our movement is relayed to it
|
||||
return mob.remote_control.relaymove(mob, direct)
|
||||
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
|
||||
return AIMove(n,direct,mob)
|
||||
|
||||
if(!mob.canmove)
|
||||
return
|
||||
|
||||
@@ -280,24 +282,6 @@
|
||||
var/tickcomp = ((1/(world.tick_lag))*1.3)
|
||||
move_delay = move_delay + tickcomp
|
||||
|
||||
if(istype(mob.buckled, /obj/vehicle) || istype(mob.buckled, /obj/structure/stool/bed/chair/cart))
|
||||
return mob.buckled.relaymove(mob,direct)
|
||||
|
||||
if(mob.pulledby || mob.buckled) // Wheelchair driving!
|
||||
if(istype(mob.loc, /turf/space))
|
||||
return // No wheelchair driving in space
|
||||
if(istype(mob.pulledby, /obj/structure/stool/bed/chair/wheelchair))
|
||||
return mob.pulledby.relaymove(mob, direct)
|
||||
else if(istype(mob.buckled, /obj/structure/stool/bed/chair/wheelchair))
|
||||
if(ishuman(mob.buckled))
|
||||
var/mob/living/carbon/human/driver = mob.buckled
|
||||
var/obj/item/organ/external/l_hand = driver.get_organ("l_hand")
|
||||
var/obj/item/organ/external/r_hand = driver.get_organ("r_hand")
|
||||
if((!l_hand || (l_hand.status & ORGAN_DESTROYED)) && (!r_hand || (r_hand.status & ORGAN_DESTROYED)))
|
||||
return // No hands to drive your chair? Tough luck!
|
||||
move_delay += 2
|
||||
return mob.buckled.relaymove(mob,direct)
|
||||
|
||||
//We are now going to move
|
||||
moving = 1
|
||||
//Something with pulling things
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
if(prob(100 * weakness))
|
||||
user << "\red You are suddenly zapped away elsewhere!"
|
||||
if (user.buckled)
|
||||
user.buckled.unbuckle()
|
||||
user.buckled.unbuckle_mob()
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
sparks.set_up(3, 0, get_turf(user))
|
||||
@@ -27,7 +27,7 @@
|
||||
if(prob(100 * weakness))
|
||||
M << "\red You are displaced by a strange force!"
|
||||
if(M.buckled)
|
||||
M.buckled.unbuckle()
|
||||
M.buckled.unbuckle_mob()
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
sparks.set_up(3, 0, get_turf(M))
|
||||
@@ -46,7 +46,7 @@
|
||||
if(prob(100 * weakness))
|
||||
M << "\red You are displaced by a strange force!"
|
||||
if(M.buckled)
|
||||
M.buckled.unbuckle()
|
||||
M.buckled.unbuckle_mob()
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
sparks.set_up(3, 0, get_turf(M))
|
||||
|
||||
@@ -36,6 +36,15 @@
|
||||
unattach()
|
||||
return 0
|
||||
|
||||
/obj/vehicle/train/can_move()
|
||||
if(!is_train_head())
|
||||
return 1 //towed objects do not need power to Move()
|
||||
|
||||
if(!..())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/vehicle/train/Bump(atom/Obstacle)
|
||||
if(!istype(Obstacle, /atom/movable))
|
||||
return
|
||||
|
||||
@@ -44,20 +44,10 @@
|
||||
key = new()
|
||||
|
||||
/obj/vehicle/train/ambulance/engine/Move()
|
||||
if(on && cell.charge < charge_use)
|
||||
turn_off()
|
||||
update_stats()
|
||||
if(load && is_train_head())
|
||||
load << "The drive motor briefly whines, then drones to a stop."
|
||||
|
||||
if(is_train_head() && !on)
|
||||
return 0
|
||||
|
||||
. = ..()
|
||||
handle_rotation()
|
||||
update_mob()
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/train/ambulance/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(open && istype(W, /obj/item/weapon/wirecutters))
|
||||
passenger_allowed = !passenger_allowed
|
||||
@@ -176,7 +166,7 @@
|
||||
return 0
|
||||
|
||||
if(is_train_head())
|
||||
if(direction == reverse_direction(dir))
|
||||
if(direction == reverse_direction(dir) && tow) //can reverse with no tow
|
||||
return 0
|
||||
if(Move(get_step(src, direction)))
|
||||
return 1
|
||||
|
||||
@@ -47,18 +47,6 @@
|
||||
overlays += I
|
||||
turn_off() //so engine verbs are correctly set
|
||||
|
||||
/obj/vehicle/train/cargo/engine/Move()
|
||||
if(on && cell.charge < charge_use)
|
||||
turn_off()
|
||||
update_stats()
|
||||
if(load && is_train_head())
|
||||
load << "The drive motor briefly whines, then drones to a stop."
|
||||
|
||||
if(is_train_head() && !on)
|
||||
return 0
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/train/cargo/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(open && istype(W, /obj/item/weapon/wirecutters))
|
||||
passenger_allowed = !passenger_allowed
|
||||
|
||||
@@ -51,20 +51,10 @@
|
||||
R.my_atom = src
|
||||
|
||||
/obj/vehicle/train/janitor/engine/Move()
|
||||
if(on && cell.charge < charge_use)
|
||||
turn_off()
|
||||
update_stats()
|
||||
if(load && is_train_head())
|
||||
load << "The drive motor briefly whines, then drones to a stop."
|
||||
|
||||
if(is_train_head() && !on)
|
||||
return 0
|
||||
|
||||
. = ..()
|
||||
handle_rotation()
|
||||
update_mob()
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/train/janitor/trolley/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(openTop)
|
||||
W.loc = src
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
animate_movement=1
|
||||
light_range = 3
|
||||
|
||||
buckle_lying = 0
|
||||
|
||||
var/attack_log = null
|
||||
var/on = 0
|
||||
var/health = 0 //do not forget to set health for your vehicle!
|
||||
@@ -40,10 +42,7 @@
|
||||
//spawn the cell you want in each vehicle
|
||||
|
||||
/obj/vehicle/Move()
|
||||
if(world.time > l_move_time + move_delay)
|
||||
if(on && powered && cell.charge < charge_use)
|
||||
turn_off()
|
||||
|
||||
if(can_move())
|
||||
var/init_anc = anchored
|
||||
anchored = 0
|
||||
if(!..())
|
||||
@@ -63,6 +62,23 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/vehicle/proc/can_move()
|
||||
if(world.time <= l_move_time + move_delay)
|
||||
return 0
|
||||
|
||||
if(!on || !powered)
|
||||
return 0
|
||||
|
||||
if(on && powered && cell.charge < charge_use)
|
||||
turn_off()
|
||||
return 0
|
||||
|
||||
if(istype(loc, /turf/space))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/vehicle/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/weapon/hand_labeler))
|
||||
return
|
||||
@@ -222,19 +238,19 @@
|
||||
|
||||
/obj/vehicle/proc/powercheck()
|
||||
if(!cell && !powered)
|
||||
return
|
||||
return 0
|
||||
|
||||
if(!cell && powered)
|
||||
turn_off()
|
||||
return
|
||||
return 0
|
||||
|
||||
if(cell.charge < charge_use)
|
||||
turn_off()
|
||||
return
|
||||
return 0
|
||||
|
||||
if(cell && powered)
|
||||
turn_on()
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/vehicle/proc/insert_cell(var/obj/item/weapon/stock_parts/cell/C, var/mob/living/carbon/human/H)
|
||||
if(cell)
|
||||
|
||||
Reference in New Issue
Block a user