Adds Boats, Ports /TG/ Buckling (#4527)
* Adds Boats, Ports /TG/ Buckling * Travis Appeasement * Changelog
@@ -71,20 +71,23 @@
|
|||||||
else if(istype(loc, /turf/space/))
|
else if(istype(loc, /turf/space/))
|
||||||
parent.radiate_heat_to_space(surface, 1)
|
parent.radiate_heat_to_space(surface, 1)
|
||||||
|
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
var/hc = pipe_air.heat_capacity()
|
for(var/M in buckled_mobs)
|
||||||
var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500)
|
var/mob/living/L = M
|
||||||
pipe_air.temperature = avg_temp
|
|
||||||
buckled_mob.bodytemperature = avg_temp
|
|
||||||
|
|
||||||
var/heat_limit = 1000
|
var/hc = pipe_air.heat_capacity()
|
||||||
|
var/avg_temp = (pipe_air.temperature * hc + L.bodytemperature * 3500) / (hc + 3500)
|
||||||
|
pipe_air.temperature = avg_temp
|
||||||
|
L.bodytemperature = avg_temp
|
||||||
|
|
||||||
var/mob/living/carbon/human/H = buckled_mob
|
var/heat_limit = 1000
|
||||||
if(istype(H) && H.species)
|
|
||||||
heat_limit = H.species.heat_level_3
|
|
||||||
|
|
||||||
if(pipe_air.temperature > heat_limit + 1)
|
var/mob/living/carbon/human/H = L
|
||||||
buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, BP_TORSO, used_weapon = "Excessive Heat")
|
if(istype(H) && H.species)
|
||||||
|
heat_limit = H.species.heat_level_3
|
||||||
|
|
||||||
|
if(pipe_air.temperature > heat_limit + 1)
|
||||||
|
L.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, BP_TORSO, used_weapon = "Excessive Heat")
|
||||||
|
|
||||||
//fancy radiation glowing
|
//fancy radiation glowing
|
||||||
if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //start glowing at 500K
|
if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //start glowing at 500K
|
||||||
|
|||||||
@@ -52,3 +52,21 @@ What is the naming convention for planes or layers?
|
|||||||
#define OPENSPACE_PLANE -25 // /turf/simulated/open will use OPENSPACE_PLANE + z (Valid z's being 2 thru 17)
|
#define OPENSPACE_PLANE -25 // /turf/simulated/open will use OPENSPACE_PLANE + z (Valid z's being 2 thru 17)
|
||||||
|
|
||||||
#define OVER_OPENSPACE_PLANE -7
|
#define OVER_OPENSPACE_PLANE -7
|
||||||
|
|
||||||
|
|
||||||
|
// Now for the regular layers. Try to keep these in order, from lowest to highest numbers, please.
|
||||||
|
|
||||||
|
//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define
|
||||||
|
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
|
||||||
|
//#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define
|
||||||
|
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
|
||||||
|
|
||||||
|
#define BELOW_MOB_LAYER 3.9
|
||||||
|
//#define MOB_LAYER 4 //For easy recordkeeping; this is a byond define
|
||||||
|
#define ABOVE_MOB_LAYER 4.1
|
||||||
|
|
||||||
|
//#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define
|
||||||
|
#define LIGHTING_LAYER 11
|
||||||
|
#define HUD_LAYER 20 //Above lighting, but below obfuscation. For in-game HUD effects (whereas SCREEN_LAYER is for abstract/OOC things like inventory slots)
|
||||||
|
#define OBFUSCATION_LAYER 21 //Where images covering the view for eyes are put
|
||||||
|
#define SCREEN_LAYER 22 //Mob HUD/effects layer
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#define LIGHTING_LAMBERTIAN 0 // use lambertian shading for light sources
|
#define LIGHTING_LAMBERTIAN 0 // use lambertian shading for light sources
|
||||||
#define LIGHTING_HEIGHT 1 // height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone
|
#define LIGHTING_HEIGHT 1 // height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone
|
||||||
|
|
||||||
#define LIGHTING_LAYER 10 // drawing layer for lighting overlays
|
//#define LIGHTING_LAYER 10 // drawing layer for lighting overlays
|
||||||
#define LIGHTING_ICON 'icons/effects/lighting_overlay.dmi' // icon used for lighting shading effects
|
#define LIGHTING_ICON 'icons/effects/lighting_overlay.dmi' // icon used for lighting shading effects
|
||||||
#define LIGHTING_ICON_STATE_DARK "soft_dark" // Change between "soft_dark" and "dark" to swap soft darkvision
|
#define LIGHTING_ICON_STATE_DARK "soft_dark" // Change between "soft_dark" and "dark" to swap soft darkvision
|
||||||
|
|
||||||
|
|||||||
@@ -121,14 +121,6 @@
|
|||||||
//Area flags, possibly more to come
|
//Area flags, possibly more to come
|
||||||
#define RAD_SHIELDED 1 //shielded from radiation, clearly
|
#define RAD_SHIELDED 1 //shielded from radiation, clearly
|
||||||
|
|
||||||
// Custom layer definitions, supplementing the default TURF_LAYER, MOB_LAYER, etc.
|
|
||||||
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
|
|
||||||
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
|
|
||||||
#define LIGHTING_LAYER 11
|
|
||||||
#define HUD_LAYER 20 //Above lighting, but below obfuscation. For in-game HUD effects (whereas SCREEN_LAYER is for abstract/OOC things like inventory slots)
|
|
||||||
#define OBFUSCATION_LAYER 21 //Where images covering the view for eyes are put
|
|
||||||
#define SCREEN_LAYER 22 //Mob HUD/effects layer
|
|
||||||
|
|
||||||
// Convoluted setup so defines can be supplied by Bay12 main server compile script.
|
// Convoluted setup so defines can be supplied by Bay12 main server compile script.
|
||||||
// Should still work fine for people jamming the icons into their repo.
|
// Should still work fine for people jamming the icons into their repo.
|
||||||
#ifndef CUSTOM_ITEM_OBJ
|
#ifndef CUSTOM_ITEM_OBJ
|
||||||
@@ -155,6 +147,10 @@
|
|||||||
#define MAT_PHORON "phoron"
|
#define MAT_PHORON "phoron"
|
||||||
#define MAT_DIAMOND "diamond"
|
#define MAT_DIAMOND "diamond"
|
||||||
#define MAT_SNOW "snow"
|
#define MAT_SNOW "snow"
|
||||||
|
#define MAT_WOOD "wood"
|
||||||
|
#define MAT_LOG "log"
|
||||||
|
#define MAT_SIFWOOD "alien wood"
|
||||||
|
#define MAT_SIFLOG "alien log"
|
||||||
|
|
||||||
#define SHARD_SHARD "shard"
|
#define SHARD_SHARD "shard"
|
||||||
#define SHARD_SHRAPNEL "shrapnel"
|
#define SHARD_SHRAPNEL "shrapnel"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
return occupant
|
return occupant
|
||||||
|
|
||||||
/obj/vehicle/train/get_mob()
|
/obj/vehicle/train/get_mob()
|
||||||
return buckled_mob
|
return buckled_mobs
|
||||||
|
|
||||||
/mob/get_mob()
|
/mob/get_mob()
|
||||||
return src
|
return src
|
||||||
|
|||||||
224
code/datums/riding.dm
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
// This is used to make things that are supposed to move while buckled more consistant and easier to handle code-wise.
|
||||||
|
|
||||||
|
/datum/riding
|
||||||
|
var/next_vehicle_move = 0 // Used for move delays
|
||||||
|
var/vehicle_move_delay = 2 // Tick delay between movements, lower = faster, higher = slower
|
||||||
|
var/keytype = null // Can give this a type to require the rider to hold the item type inhand to move the ridden atom.
|
||||||
|
var/nonhuman_key_exemption = FALSE // If true, nonhumans who can't hold keys don't need them, like borgs and simplemobs.
|
||||||
|
var/key_name = "the keys" // What the 'keys' for the thing being rided on would be called.
|
||||||
|
var/atom/movable/ridden = null // The thing that the datum is attached to.
|
||||||
|
var/only_one_driver = FALSE // If true, only the person in 'front' (first on list of riding mobs) can drive.
|
||||||
|
|
||||||
|
/datum/riding/New(atom/movable/_ridden)
|
||||||
|
ridden = _ridden
|
||||||
|
|
||||||
|
/datum/riding/Destroy()
|
||||||
|
ridden = null
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/datum/riding/proc/handle_vehicle_layer()
|
||||||
|
if(ridden.dir != NORTH)
|
||||||
|
ridden.layer = ABOVE_MOB_LAYER
|
||||||
|
else
|
||||||
|
ridden.layer = OBJ_LAYER
|
||||||
|
|
||||||
|
/datum/riding/proc/on_vehicle_move()
|
||||||
|
for(var/mob/living/M in ridden.buckled_mobs)
|
||||||
|
ride_check(M)
|
||||||
|
handle_vehicle_offsets()
|
||||||
|
handle_vehicle_layer()
|
||||||
|
|
||||||
|
/datum/riding/proc/ride_check(mob/living/M)
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
/datum/riding/proc/force_dismount(mob/living/M)
|
||||||
|
ridden.unbuckle_mob(M)
|
||||||
|
|
||||||
|
/datum/riding/proc/handle_vehicle_offsets()
|
||||||
|
var/ridden_dir = "[ridden.dir]"
|
||||||
|
var/passindex = 0
|
||||||
|
if(ridden.has_buckled_mobs())
|
||||||
|
for(var/m in ridden.buckled_mobs)
|
||||||
|
passindex++
|
||||||
|
var/mob/living/buckled_mob = m
|
||||||
|
var/list/offsets = get_offsets(passindex)
|
||||||
|
var/rider_dir = get_rider_dir(passindex)
|
||||||
|
buckled_mob.set_dir(rider_dir)
|
||||||
|
dir_loop:
|
||||||
|
for(var/offsetdir in offsets)
|
||||||
|
if(offsetdir == ridden_dir)
|
||||||
|
var/list/diroffsets = offsets[offsetdir]
|
||||||
|
buckled_mob.pixel_x = diroffsets[1]
|
||||||
|
if(diroffsets.len >= 2)
|
||||||
|
buckled_mob.pixel_y = diroffsets[2]
|
||||||
|
if(diroffsets.len == 3)
|
||||||
|
buckled_mob.layer = diroffsets[3]
|
||||||
|
break dir_loop
|
||||||
|
|
||||||
|
// Override this to set your vehicle's various pixel offsets
|
||||||
|
/datum/riding/proc/get_offsets(pass_index) // list(dir = x, y, layer)
|
||||||
|
return list("[NORTH]" = list(0, 0), "[SOUTH]" = list(0, 0), "[EAST]" = list(0, 0), "[WEST]" = list(0, 0))
|
||||||
|
|
||||||
|
// Override this to set the passengers/riders dir based on which passenger they are.
|
||||||
|
// ie: rider facing the vehicle's dir, but passenger 2 facing backwards, etc.
|
||||||
|
/datum/riding/proc/get_rider_dir(pass_index)
|
||||||
|
return ridden.dir
|
||||||
|
|
||||||
|
// KEYS
|
||||||
|
/datum/riding/proc/keycheck(mob/user)
|
||||||
|
if(keytype)
|
||||||
|
if(nonhuman_key_exemption && !ishuman(user))
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
if(user.is_holding_item_of_type(keytype))
|
||||||
|
return TRUE
|
||||||
|
else
|
||||||
|
return TRUE
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
// BUCKLE HOOKS
|
||||||
|
/datum/riding/proc/restore_position(mob/living/buckled_mob)
|
||||||
|
if(istype(buckled_mob))
|
||||||
|
buckled_mob.pixel_x = 0
|
||||||
|
buckled_mob.pixel_y = 0
|
||||||
|
buckled_mob.layer = initial(buckled_mob.layer)
|
||||||
|
|
||||||
|
// MOVEMENT
|
||||||
|
/datum/riding/proc/handle_ride(mob/user, direction)
|
||||||
|
if(user.incapacitated())
|
||||||
|
Unbuckle(user)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(only_one_driver && ridden.buckled_mobs.len)
|
||||||
|
var/mob/living/driver = ridden.buckled_mobs[1]
|
||||||
|
if(driver != user)
|
||||||
|
to_chat(user, "<span class='warning'>\The [ridden] can only be controlled by one person at a time, and is currently being controlled by \the [driver].</span>")
|
||||||
|
return
|
||||||
|
|
||||||
|
if(world.time < next_vehicle_move)
|
||||||
|
return
|
||||||
|
next_vehicle_move = world.time + vehicle_move_delay
|
||||||
|
if(keycheck(user))
|
||||||
|
if(!Process_Spacemove(direction) || !isturf(ridden.loc))
|
||||||
|
return
|
||||||
|
step(ridden, direction)
|
||||||
|
|
||||||
|
handle_vehicle_layer()
|
||||||
|
handle_vehicle_offsets()
|
||||||
|
else
|
||||||
|
to_chat(user, "<span class='warning'>You'll need [key_name] in one of your hands to move \the [ridden].</span>")
|
||||||
|
|
||||||
|
/datum/riding/proc/Unbuckle(atom/movable/M)
|
||||||
|
// addtimer(CALLBACK(ridden, /atom/movable/.proc/unbuckle_mob, M), 0, TIMER_UNIQUE)
|
||||||
|
spawn(0)
|
||||||
|
// On /tg/ this uses the fancy CALLBACK system. Not entirely sure why they needed to do so with a duration of 0,
|
||||||
|
// so if there is a reason, this should replicate it close enough. Hopefully.
|
||||||
|
ridden.unbuckle_mob(M)
|
||||||
|
|
||||||
|
/datum/riding/proc/Process_Spacemove(direction)
|
||||||
|
if(ridden.has_gravity())
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
/datum/riding/space/Process_Spacemove(direction)
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// SUBTYPES
|
||||||
|
|
||||||
|
// I'm on a
|
||||||
|
/datum/riding/boat
|
||||||
|
keytype = /obj/item/weapon/oar
|
||||||
|
key_name = "an oar"
|
||||||
|
nonhuman_key_exemption = TRUE // Borgs can't hold oars.
|
||||||
|
only_one_driver = TRUE // Would be pretty crazy if five people try to move at the same time.
|
||||||
|
|
||||||
|
/datum/riding/boat/handle_ride(mob/user, direction)
|
||||||
|
var/turf/next = get_step(ridden, direction)
|
||||||
|
var/turf/current = get_turf(ridden)
|
||||||
|
|
||||||
|
if(istype(next, /turf/simulated/floor/water) || istype(current, /turf/simulated/floor/water)) //We can move from land to water, or water to land, but not from land to land
|
||||||
|
..()
|
||||||
|
else
|
||||||
|
to_chat(user, "<span class='warning'>Boats don't go on land!</span>")
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
/datum/riding/boat/small // 'Small' boats can hold up to two people.
|
||||||
|
|
||||||
|
/datum/riding/boat/small/get_offsets(pass_index) // list(dir = x, y, layer)
|
||||||
|
var/H = 7 // Horizontal seperation.
|
||||||
|
var/V = 5 // Vertical seperation.
|
||||||
|
var/O = 2 // Vertical offset.
|
||||||
|
switch(pass_index)
|
||||||
|
if(1) // Person in front.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list( 0, O+V, MOB_LAYER),
|
||||||
|
"[SOUTH]" = list( 0, O, ABOVE_MOB_LAYER),
|
||||||
|
"[EAST]" = list( H, O, MOB_LAYER),
|
||||||
|
"[WEST]" = list(-H, O, MOB_LAYER)
|
||||||
|
)
|
||||||
|
if(2) // Person in back.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list( 0, O, ABOVE_MOB_LAYER),
|
||||||
|
"[SOUTH]" = list( 0, O+V, MOB_LAYER),
|
||||||
|
"[EAST]" = list(-H, O, MOB_LAYER),
|
||||||
|
"[WEST]" = list( H, O, MOB_LAYER)
|
||||||
|
)
|
||||||
|
else
|
||||||
|
return null // This will runtime, but we want that since this is out of bounds.
|
||||||
|
|
||||||
|
/datum/riding/boat/small/handle_vehicle_layer()
|
||||||
|
ridden.layer = ABOVE_MOB_LAYER
|
||||||
|
|
||||||
|
/datum/riding/boat/big // 'Big' boats can hold up to five people.
|
||||||
|
|
||||||
|
/datum/riding/boat/big/get_offsets(pass_index) // list(dir = x, y, layer)
|
||||||
|
var/H = 12 // Horizontal seperation. Halved when facing up-down.
|
||||||
|
var/V = 4 // Vertical seperation.
|
||||||
|
var/O = 7 // Vertical offset.
|
||||||
|
switch(pass_index)
|
||||||
|
if(1) // Person in center front, first row.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list( 0, O+V, MOB_LAYER+0.1),
|
||||||
|
"[SOUTH]" = list( 0, O-V, MOB_LAYER+0.3),
|
||||||
|
"[EAST]" = list( H, O, MOB_LAYER+0.1),
|
||||||
|
"[WEST]" = list(-H, O, MOB_LAYER+0.1)
|
||||||
|
)
|
||||||
|
if(2) // Person in left, second row.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list( H/2, O, MOB_LAYER+0.2),
|
||||||
|
"[SOUTH]" = list(-H/2, O, MOB_LAYER+0.2),
|
||||||
|
"[EAST]" = list( 0, O-V, MOB_LAYER+0.2),
|
||||||
|
"[WEST]" = list( 0, O+V, MOB_LAYER)
|
||||||
|
)
|
||||||
|
if(3) // Person in right, second row.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list(-H/2, O, MOB_LAYER+0.2),
|
||||||
|
"[SOUTH]" = list( H/2, O, MOB_LAYER+0.2),
|
||||||
|
"[EAST]" = list( 0, O+V, MOB_LAYER),
|
||||||
|
"[WEST]" = list( 0, O-V, MOB_LAYER+0.2)
|
||||||
|
)
|
||||||
|
if(4) // Person in left, third row.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list( H/2, O-V, MOB_LAYER+0.3),
|
||||||
|
"[SOUTH]" = list(-H/2, O+V, MOB_LAYER+0.1),
|
||||||
|
"[EAST]" = list(-H, O-V, MOB_LAYER+0.2),
|
||||||
|
"[WEST]" = list( H, O+V, MOB_LAYER)
|
||||||
|
)
|
||||||
|
if(5) // Person in right, third row.
|
||||||
|
return list(
|
||||||
|
"[NORTH]" = list(-H/2, O-V, MOB_LAYER+0.3),
|
||||||
|
"[SOUTH]" = list( H/2, O+V, MOB_LAYER+0.1),
|
||||||
|
"[EAST]" = list(-H, O+V, MOB_LAYER),
|
||||||
|
"[WEST]" = list( H, O-V, MOB_LAYER+0.2)
|
||||||
|
)
|
||||||
|
else
|
||||||
|
return null // This will runtime, but we want that since this is out of bounds.
|
||||||
|
|
||||||
|
/datum/riding/boat/big/handle_vehicle_layer()
|
||||||
|
ridden.layer = MOB_LAYER+0.4
|
||||||
|
|
||||||
|
/datum/riding/boat/get_offsets(pass_index) // list(dir = x, y, layer)
|
||||||
|
return list("[NORTH]" = list(1, 2), "[SOUTH]" = list(1, 2), "[EAST]" = list(1, 2), "[WEST]" = list(1, 2))
|
||||||
@@ -294,7 +294,7 @@ var/list/mob/living/forced_ambiance_list = new
|
|||||||
for(var/obj/machinery/door/window/temp_windoor in src)
|
for(var/obj/machinery/door/window/temp_windoor in src)
|
||||||
temp_windoor.open()
|
temp_windoor.open()
|
||||||
|
|
||||||
/area/proc/has_gravity()
|
/area/has_gravity()
|
||||||
return has_gravity
|
return has_gravity
|
||||||
|
|
||||||
/area/space/has_gravity()
|
/area/space/has_gravity()
|
||||||
|
|||||||
@@ -519,3 +519,13 @@ its easier to just keep the beam vertical.
|
|||||||
|
|
||||||
/atom/proc/InsertedContents()
|
/atom/proc/InsertedContents()
|
||||||
return contents
|
return contents
|
||||||
|
|
||||||
|
/atom/proc/has_gravity(turf/T)
|
||||||
|
if(!T || !isturf(T))
|
||||||
|
T = get_turf(src)
|
||||||
|
if(istype(T, /turf/space)) // Turf never has gravity
|
||||||
|
return FALSE
|
||||||
|
var/area/A = get_area(T)
|
||||||
|
if(A && A.has_gravity())
|
||||||
|
return TRUE
|
||||||
|
return FALSE
|
||||||
|
|||||||
@@ -93,6 +93,8 @@
|
|||||||
AM.Crossed(src)
|
AM.Crossed(src)
|
||||||
if(is_new_area && is_destination_turf)
|
if(is_new_area && is_destination_turf)
|
||||||
destination.loc.Entered(src, origin)
|
destination.loc.Entered(src, origin)
|
||||||
|
|
||||||
|
Moved(origin)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
//called when src is thrown into hit_atom
|
//called when src is thrown into hit_atom
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ var/global/datum/controller/occupations/job_master
|
|||||||
H.buckled = W
|
H.buckled = W
|
||||||
H.update_canmove()
|
H.update_canmove()
|
||||||
W.set_dir(H.dir)
|
W.set_dir(H.dir)
|
||||||
W.buckled_mob = H
|
W.buckled_mobs |= H
|
||||||
W.add_fingerprint(H)
|
W.add_fingerprint(H)
|
||||||
if(R)
|
if(R)
|
||||||
W.color = R.color
|
W.color = R.color
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
//loading
|
//loading
|
||||||
if(istype(target,/obj))
|
if(istype(target,/obj))
|
||||||
var/obj/O = target
|
var/obj/O = target
|
||||||
if(O.buckled_mob)
|
if(O.has_buckled_mobs())
|
||||||
return
|
return
|
||||||
if(locate(/mob/living) in O)
|
if(locate(/mob/living) in O)
|
||||||
occupant_message("<span class='warning'>You can't load living things into the cargo compartment.</span>")
|
occupant_message("<span class='warning'>You can't load living things into the cargo compartment.</span>")
|
||||||
|
|||||||
@@ -6,26 +6,44 @@
|
|||||||
var/buckle_dir = 0
|
var/buckle_dir = 0
|
||||||
var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1
|
var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1
|
||||||
var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes
|
var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes
|
||||||
var/mob/living/buckled_mob = null
|
// var/mob/living/buckled_mob = null
|
||||||
|
var/list/mob/living/buckled_mobs = null //list()
|
||||||
|
var/max_buckled_mobs = 1
|
||||||
|
|
||||||
|
|
||||||
/atom/movable/attack_hand(mob/living/user)
|
/atom/movable/attack_hand(mob/living/user)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(can_buckle && buckled_mob)
|
// if(can_buckle && buckled_mob)
|
||||||
user_unbuckle_mob(user)
|
// user_unbuckle_mob(user)
|
||||||
|
|
||||||
|
if(can_buckle && has_buckled_mobs())
|
||||||
|
if(buckled_mobs.len > 1)
|
||||||
|
var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in buckled_mobs
|
||||||
|
if(user_unbuckle_mob(unbuckled, user))
|
||||||
|
return TRUE
|
||||||
|
else
|
||||||
|
if(user_unbuckle_mob(buckled_mobs[1], user))
|
||||||
|
return TRUE
|
||||||
|
|
||||||
/obj/proc/attack_alien(mob/user as mob) //For calling in the event of Xenomorph or other alien checks.
|
/obj/proc/attack_alien(mob/user as mob) //For calling in the event of Xenomorph or other alien checks.
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/attack_robot(mob/living/user)
|
/obj/attack_robot(mob/living/user)
|
||||||
if(Adjacent(user) && buckled_mob) //Checks if what we're touching is adjacent to us and has someone buckled to it. This should prevent interacting with anti-robot manual valves among other things.
|
if(Adjacent(user) && has_buckled_mobs()) //Checks if what we're touching is adjacent to us and has someone buckled to it. This should prevent interacting with anti-robot manual valves among other things.
|
||||||
return attack_hand(user) //Process as if we're a normal person touching the object.
|
return attack_hand(user) //Process as if we're a normal person touching the object.
|
||||||
return ..() //Otherwise, treat this as an AI click like usual.
|
return ..() //Otherwise, treat this as an AI click like usual.
|
||||||
|
|
||||||
/atom/movable/MouseDrop_T(mob/living/M, mob/living/user)
|
/atom/movable/MouseDrop_T(mob/living/M, mob/living/user)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(can_buckle && istype(M))
|
if(can_buckle && istype(M))
|
||||||
user_buckle_mob(M, user)
|
if(user_buckle_mob(M, user))
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
/atom/movable/proc/has_buckled_mobs()
|
||||||
|
if(!buckled_mobs)
|
||||||
|
return FALSE
|
||||||
|
if(buckled_mobs.len)
|
||||||
|
return TRUE
|
||||||
|
|
||||||
/atom/movable/Destroy()
|
/atom/movable/Destroy()
|
||||||
unbuckle_mob()
|
unbuckle_mob()
|
||||||
@@ -33,52 +51,81 @@
|
|||||||
|
|
||||||
|
|
||||||
/atom/movable/proc/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE)
|
/atom/movable/proc/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE)
|
||||||
if((!can_buckle && !forced) || !istype(M) || M.buckled || M.pinned.len || (buckle_require_restraints && !M.restrained()))
|
if(!buckled_mobs)
|
||||||
return 0
|
buckled_mobs = list()
|
||||||
|
|
||||||
|
if(!istype(M))
|
||||||
|
return FALSE
|
||||||
|
|
||||||
if(check_loc && M.loc != loc)
|
if(check_loc && M.loc != loc)
|
||||||
return 0
|
return FALSE
|
||||||
if(buckled_mob) //Handles trying to buckle yourself to the chair when someone is on it
|
|
||||||
M << "<span class='notice'>\The [src] already has someone buckled to it.</span>"
|
if((!can_buckle && !forced) || M.buckled || M.pinned.len || (buckled_mobs.len >= max_buckled_mobs) || (buckle_require_restraints && !M.restrained()))
|
||||||
return 0
|
return FALSE
|
||||||
|
|
||||||
|
if(has_buckled_mobs() && buckled_mobs.len >= max_buckled_mobs) //Handles trying to buckle yourself to the chair when someone is on it
|
||||||
|
to_chat(M, "<span class='notice'>\The [src] can't buckle anymore people.</span>")
|
||||||
|
return FALSE
|
||||||
|
|
||||||
M.buckled = src
|
M.buckled = src
|
||||||
M.facing_dir = null
|
M.facing_dir = null
|
||||||
M.set_dir(buckle_dir ? buckle_dir : dir)
|
M.set_dir(buckle_dir ? buckle_dir : dir)
|
||||||
M.update_canmove()
|
M.update_canmove()
|
||||||
M.update_floating( M.Check_Dense_Object() )
|
M.update_floating( M.Check_Dense_Object() )
|
||||||
buckled_mob = M
|
// buckled_mob = M
|
||||||
|
buckled_mobs |= M
|
||||||
|
|
||||||
post_buckle_mob(M)
|
post_buckle_mob(M)
|
||||||
return 1
|
return TRUE
|
||||||
|
|
||||||
|
/atom/movable/proc/unbuckle_mob(mob/living/buckled_mob, force = FALSE)
|
||||||
|
if(!buckled_mob) // If we didn't get told which mob needs to get unbuckled, just assume its the first one on the list.
|
||||||
|
if(has_buckled_mobs())
|
||||||
|
buckled_mob = buckled_mobs[1]
|
||||||
|
else
|
||||||
|
return
|
||||||
|
|
||||||
/atom/movable/proc/unbuckle_mob()
|
|
||||||
if(buckled_mob && buckled_mob.buckled == src)
|
if(buckled_mob && buckled_mob.buckled == src)
|
||||||
. = buckled_mob
|
. = buckled_mob
|
||||||
buckled_mob.buckled = null
|
buckled_mob.buckled = null
|
||||||
buckled_mob.anchored = initial(buckled_mob.anchored)
|
buckled_mob.anchored = initial(buckled_mob.anchored)
|
||||||
buckled_mob.update_canmove()
|
buckled_mob.update_canmove()
|
||||||
buckled_mob.update_floating( buckled_mob.Check_Dense_Object() )
|
buckled_mob.update_floating( buckled_mob.Check_Dense_Object() )
|
||||||
buckled_mob = null
|
// buckled_mob = null
|
||||||
|
buckled_mobs -= buckled_mob
|
||||||
|
|
||||||
post_buckle_mob(.)
|
post_buckle_mob(.)
|
||||||
|
|
||||||
|
/atom/movable/proc/unbuckle_all_mobs(force = FALSE)
|
||||||
|
if(!has_buckled_mobs())
|
||||||
|
return
|
||||||
|
for(var/m in buckled_mobs)
|
||||||
|
unbuckle_mob(m, force)
|
||||||
|
|
||||||
|
//Handle any extras after buckling/unbuckling
|
||||||
|
//Called on buckle_mob() and unbuckle_mob()
|
||||||
/atom/movable/proc/post_buckle_mob(mob/living/M)
|
/atom/movable/proc/post_buckle_mob(mob/living/M)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
//Wrapper procs that handle sanity and user feedback
|
||||||
/atom/movable/proc/user_buckle_mob(mob/living/M, mob/user, var/forced = FALSE, var/silent = FALSE)
|
/atom/movable/proc/user_buckle_mob(mob/living/M, mob/user, var/forced = FALSE, var/silent = FALSE)
|
||||||
if(!ticker)
|
if(!ticker)
|
||||||
user << "<span class='warning'>You can't buckle anyone in before the game starts.</span>"
|
user << "<span class='warning'>You can't buckle anyone in before the game starts.</span>"
|
||||||
|
return FALSE // Is this really needed?
|
||||||
if(!user.Adjacent(M) || user.restrained() || user.stat || istype(user, /mob/living/silicon/pai))
|
if(!user.Adjacent(M) || user.restrained() || user.stat || istype(user, /mob/living/silicon/pai))
|
||||||
return
|
return FALSE
|
||||||
if(M == buckled_mob)
|
if(M in buckled_mobs)
|
||||||
return
|
to_chat(user, "<span class='warning'>\The [M] is already buckled to \the [src].</span>")
|
||||||
|
return FALSE
|
||||||
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
unbuckle_mob()
|
// unbuckle_mob()
|
||||||
|
|
||||||
//can't buckle unless you share locs so try to move M to the obj.
|
//can't buckle unless you share locs so try to move M to the obj.
|
||||||
if(M.loc != src.loc)
|
if(M.loc != src.loc)
|
||||||
step_towards(M, src)
|
if(M.Adjacent(src) && user.Adjacent(src))
|
||||||
|
M.forceMove(get_turf(src))
|
||||||
|
// step_towards(M, src)
|
||||||
|
|
||||||
. = buckle_mob(M, forced)
|
. = buckle_mob(M, forced)
|
||||||
if(.)
|
if(.)
|
||||||
@@ -94,8 +141,8 @@
|
|||||||
"<span class='danger'>You are buckled to [src] by [user.name]!</span>",\
|
"<span class='danger'>You are buckled to [src] by [user.name]!</span>",\
|
||||||
"<span class='notice'>You hear metal clanking.</span>")
|
"<span class='notice'>You hear metal clanking.</span>")
|
||||||
|
|
||||||
/atom/movable/proc/user_unbuckle_mob(mob/user)
|
/atom/movable/proc/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
|
||||||
var/mob/living/M = unbuckle_mob()
|
var/mob/living/M = unbuckle_mob(buckled_mob)
|
||||||
if(M)
|
if(M)
|
||||||
if(M != user)
|
if(M != user)
|
||||||
M.visible_message(\
|
M.visible_message(\
|
||||||
@@ -111,18 +158,20 @@
|
|||||||
return M
|
return M
|
||||||
|
|
||||||
/atom/movable/proc/handle_buckled_mob_movement(newloc,direct)
|
/atom/movable/proc/handle_buckled_mob_movement(newloc,direct)
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
// if(!buckled_mob.Move(newloc, direct))
|
for(var/A in buckled_mobs)
|
||||||
if(!buckled_mob.forceMove(newloc, direct))
|
var/mob/living/L = A
|
||||||
loc = buckled_mob.loc
|
// if(!L.Move(newloc, direct))
|
||||||
last_move = buckled_mob.last_move
|
if(!L.forceMove(newloc, direct))
|
||||||
buckled_mob.inertia_dir = last_move
|
loc = L.loc
|
||||||
return FALSE
|
last_move = L.last_move
|
||||||
else
|
L.inertia_dir = last_move
|
||||||
buckled_mob.set_dir(dir)
|
return FALSE
|
||||||
|
else
|
||||||
|
L.set_dir(dir)
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/atom/movable/Move(atom/newloc, direct = 0)
|
/atom/movable/Move(atom/newloc, direct = 0)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(. && buckled_mob && !handle_buckled_mob_movement(newloc, direct)) //movement failed due to buckled mob(s)
|
if(. && has_buckled_mobs() && !handle_buckled_mob_movement(newloc, direct)) //movement failed due to buckled mob(s)
|
||||||
. = 0
|
. = 0
|
||||||
|
|||||||
@@ -113,3 +113,4 @@
|
|||||||
icon_state = "survivalknife"
|
icon_state = "survivalknife"
|
||||||
item_state = "knife"
|
item_state = "knife"
|
||||||
applies_material_colour = FALSE
|
applies_material_colour = FALSE
|
||||||
|
toolspeed = 2 // Use a real axe if you want to chop logs.
|
||||||
|
|||||||
@@ -42,14 +42,16 @@
|
|||||||
anchored = 1
|
anchored = 1
|
||||||
|
|
||||||
/obj/item/weapon/beartrap/attack_hand(mob/user as mob)
|
/obj/item/weapon/beartrap/attack_hand(mob/user as mob)
|
||||||
if(buckled_mob && can_use(user))
|
if(has_buckled_mobs() && can_use(user))
|
||||||
|
var/victim = english_list(buckled_mobs)
|
||||||
user.visible_message(
|
user.visible_message(
|
||||||
"<span class='notice'>[user] begins freeing [buckled_mob] from \the [src].</span>",
|
"<span class='notice'>[user] begins freeing [victim] from \the [src].</span>",
|
||||||
"<span class='notice'>You carefully begin to free [buckled_mob] from \the [src].</span>",
|
"<span class='notice'>You carefully begin to free [victim] from \the [src].</span>",
|
||||||
)
|
)
|
||||||
if(do_after(user, 60))
|
if(do_after(user, 60))
|
||||||
user.visible_message("<span class='notice'>[buckled_mob] has been freed from \the [src] by [user].</span>")
|
user.visible_message("<span class='notice'>[victim] has been freed from \the [src] by [user].</span>")
|
||||||
unbuckle_mob()
|
for(var/A in buckled_mobs)
|
||||||
|
unbuckle_mob(A)
|
||||||
anchored = 0
|
anchored = 0
|
||||||
else if(deployed && can_use(user))
|
else if(deployed && can_use(user))
|
||||||
user.visible_message(
|
user.visible_message(
|
||||||
@@ -109,7 +111,7 @@
|
|||||||
"<b>You hear a loud metallic snap!</b>"
|
"<b>You hear a loud metallic snap!</b>"
|
||||||
)
|
)
|
||||||
attack_mob(L)
|
attack_mob(L)
|
||||||
if(!buckled_mob)
|
if(!has_buckled_mobs())
|
||||||
anchored = 0
|
anchored = 0
|
||||||
deployed = 0
|
deployed = 0
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|||||||
@@ -111,39 +111,41 @@
|
|||||||
processing_objects |= src
|
processing_objects |= src
|
||||||
|
|
||||||
/obj/effect/energy_net/Destroy()
|
/obj/effect/energy_net/Destroy()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
to_chat(buckled_mob,"<span class='notice'>You are free of the net!</span>")
|
for(var/A in buckled_mobs)
|
||||||
unbuckle_mob()
|
to_chat(A,"<span class='notice'>You are free of the net!</span>")
|
||||||
|
unbuckle_mob(A)
|
||||||
|
|
||||||
processing_objects -= src
|
processing_objects -= src
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/effect/energy_net/process()
|
/obj/effect/energy_net/process()
|
||||||
if(isnull(buckled_mob) || buckled_mob.loc != loc)
|
if(!has_buckled_mobs())
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/obj/effect/energy_net/Move()
|
/obj/effect/energy_net/Move()
|
||||||
..()
|
..()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
var/mob/living/occupant = buckled_mob
|
for(var/A in buckled_mobs)
|
||||||
occupant.buckled = null
|
var/mob/living/occupant = A
|
||||||
occupant.forceMove(src.loc)
|
occupant.buckled = null
|
||||||
occupant.buckled = src
|
occupant.forceMove(src.loc)
|
||||||
if (occupant && (src.loc != occupant.loc))
|
occupant.buckled = src
|
||||||
unbuckle_mob()
|
if (occupant && (src.loc != occupant.loc))
|
||||||
qdel(src)
|
unbuckle_mob(occupant)
|
||||||
|
qdel(src)
|
||||||
|
|
||||||
/obj/effect/energy_net/user_unbuckle_mob(mob/user)
|
/obj/effect/energy_net/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
|
||||||
user.setClickCooldown(user.get_attack_speed())
|
user.setClickCooldown(user.get_attack_speed())
|
||||||
visible_message("<span class='danger'>[user] begins to tear at \the [src]!</span>")
|
visible_message("<span class='danger'>[user] begins to tear at \the [src]!</span>")
|
||||||
if(do_after(usr, escape_time, src, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY)))
|
if(do_after(usr, escape_time, src, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY)))
|
||||||
if(!buckled_mob)
|
if(!has_buckled_mobs())
|
||||||
return
|
return
|
||||||
visible_message("<span class='danger'>[user] manages to tear \the [src] apart!</span>")
|
visible_message("<span class='danger'>[user] manages to tear \the [src] apart!</span>")
|
||||||
unbuckle_mob()
|
unbuckle_mob(buckled_mob)
|
||||||
|
|
||||||
/obj/effect/energy_net/post_buckle_mob(mob/living/M)
|
/obj/effect/energy_net/post_buckle_mob(mob/living/M)
|
||||||
if(buckled_mob) //Just buckled someone
|
if(M.buckled == src) //Just buckled someone
|
||||||
..()
|
..()
|
||||||
layer = M.layer+1
|
layer = M.layer+1
|
||||||
M.can_pull_size = 0
|
M.can_pull_size = 0
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
/obj/structure/bonfire/New(newloc, material_name)
|
/obj/structure/bonfire/New(newloc, material_name)
|
||||||
..(newloc)
|
..(newloc)
|
||||||
if(!material_name)
|
if(!material_name)
|
||||||
material_name = "wood"
|
material_name = MAT_WOOD
|
||||||
material = get_material_by_name("[material_name]")
|
material = get_material_by_name("[material_name]")
|
||||||
if(!material)
|
if(!material)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
@@ -23,14 +23,14 @@
|
|||||||
|
|
||||||
// Blue wood.
|
// Blue wood.
|
||||||
/obj/structure/bonfire/sifwood/New(newloc, material_name)
|
/obj/structure/bonfire/sifwood/New(newloc, material_name)
|
||||||
..(newloc, "alien wood")
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
/obj/structure/bonfire/permanent/New(newloc, material_name)
|
/obj/structure/bonfire/permanent/New(newloc, material_name)
|
||||||
..()
|
..()
|
||||||
ignite()
|
ignite()
|
||||||
|
|
||||||
/obj/structure/bonfire/permanent/sifwood/New(newloc, material_name)
|
/obj/structure/bonfire/permanent/sifwood/New(newloc, material_name)
|
||||||
..(newloc, "alien wood")
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
/obj/structure/bonfire/attackby(obj/item/W, mob/user)
|
/obj/structure/bonfire/attackby(obj/item/W, mob/user)
|
||||||
if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill)
|
if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill)
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/bonfire/attack_hand(mob/user)
|
/obj/structure/bonfire/attack_hand(mob/user)
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
if(get_fuel_amount())
|
if(get_fuel_amount())
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
I.appearance_flags = RESET_COLOR
|
I.appearance_flags = RESET_COLOR
|
||||||
overlays += I
|
overlays += I
|
||||||
|
|
||||||
if(buckled_mob && get_fuel_amount() >= 5)
|
if(has_buckled_mobs() && get_fuel_amount() >= 5)
|
||||||
I = image(icon, "bonfire_intense")
|
I = image(icon, "bonfire_intense")
|
||||||
I.pixel_y = 13
|
I.pixel_y = 13
|
||||||
I.layer = MOB_LAYER + 0.1
|
I.layer = MOB_LAYER + 0.1
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
extinguish()
|
extinguish()
|
||||||
|
|
||||||
/obj/structure/bonfire/post_buckle_mob(mob/living/M)
|
/obj/structure/bonfire/post_buckle_mob(mob/living/M)
|
||||||
if(buckled_mob) // Just buckled someone
|
if(M.buckled == src) // Just buckled someone
|
||||||
M.pixel_y += 13
|
M.pixel_y += 13
|
||||||
else // Just unbuckled someone
|
else // Just unbuckled someone
|
||||||
M.pixel_y -= 13
|
M.pixel_y -= 13
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
continue
|
continue
|
||||||
if(istype(O, /obj/structure/bed)) //This is only necessary because of rollerbeds and swivel chairs.
|
if(istype(O, /obj/structure/bed)) //This is only necessary because of rollerbeds and swivel chairs.
|
||||||
var/obj/structure/bed/B = O
|
var/obj/structure/bed/B = O
|
||||||
if(B.buckled_mob)
|
if(B.has_buckled_mobs())
|
||||||
continue
|
continue
|
||||||
O.forceMove(src)
|
O.forceMove(src)
|
||||||
itemcount++
|
itemcount++
|
||||||
|
|||||||
@@ -64,12 +64,14 @@
|
|||||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||||
s.set_up(12, 1, src)
|
s.set_up(12, 1, src)
|
||||||
s.start()
|
s.start()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
buckled_mob.burn_skin(85)
|
for(var/a in buckled_mobs)
|
||||||
buckled_mob << "<span class='danger'>You feel a deep shock course through your body!</span>"
|
var/mob/living/L = a
|
||||||
sleep(1)
|
L.burn_skin(85)
|
||||||
buckled_mob.burn_skin(85)
|
to_chat(L, "<span class='danger'>You feel a deep shock course through your body!</span>")
|
||||||
buckled_mob.Stun(600)
|
sleep(1)
|
||||||
|
L.burn_skin(85)
|
||||||
|
L.Stun(600)
|
||||||
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='danger'>You hear a deep sharp shock!</span>")
|
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='danger'>You hear a deep sharp shock!</span>")
|
||||||
|
|
||||||
A.power_light = light
|
A.power_light = light
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
icon = 'icons/obj/janitor.dmi'
|
icon = 'icons/obj/janitor.dmi'
|
||||||
icon_state = "cart"
|
icon_state = "cart"
|
||||||
anchored = 0
|
anchored = 0
|
||||||
density = 1
|
density = 1
|
||||||
climbable = 1
|
climbable = 1
|
||||||
flags = OPENCONTAINER
|
flags = OPENCONTAINER
|
||||||
//copypaste sorry
|
//copypaste sorry
|
||||||
@@ -229,9 +229,11 @@
|
|||||||
|
|
||||||
/obj/structure/bed/chair/janicart/Move()
|
/obj/structure/bed/chair/janicart/Move()
|
||||||
..()
|
..()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
if(buckled_mob.buckled == src)
|
for(var/A in buckled_mobs)
|
||||||
buckled_mob.loc = loc
|
var/mob/living/L = A
|
||||||
|
if(L.buckled == src)
|
||||||
|
L.loc = loc
|
||||||
|
|
||||||
|
|
||||||
/obj/structure/bed/chair/janicart/post_buckle_mob(mob/living/M)
|
/obj/structure/bed/chair/janicart/post_buckle_mob(mob/living/M)
|
||||||
@@ -257,36 +259,41 @@
|
|||||||
/obj/structure/bed/chair/janicart/set_dir()
|
/obj/structure/bed/chair/janicart/set_dir()
|
||||||
..()
|
..()
|
||||||
update_layer()
|
update_layer()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
if(buckled_mob.loc != loc)
|
for(var/A in buckled_mobs)
|
||||||
buckled_mob.buckled = null //Temporary, so Move() succeeds.
|
var/mob/living/L = A
|
||||||
buckled_mob.buckled = src //Restoring
|
if(L.loc != loc)
|
||||||
|
L.buckled = null //Temporary, so Move() succeeds.
|
||||||
|
L.buckled = src //Restoring
|
||||||
|
|
||||||
update_mob()
|
update_mob()
|
||||||
|
|
||||||
|
|
||||||
/obj/structure/bed/chair/janicart/proc/update_mob()
|
/obj/structure/bed/chair/janicart/proc/update_mob()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
buckled_mob.set_dir(dir)
|
for(var/A in buckled_mobs)
|
||||||
switch(dir)
|
var/mob/living/L = A
|
||||||
if(SOUTH)
|
L.set_dir(dir)
|
||||||
buckled_mob.pixel_x = 0
|
switch(dir)
|
||||||
buckled_mob.pixel_y = 7
|
if(SOUTH)
|
||||||
if(WEST)
|
L.pixel_x = 0
|
||||||
buckled_mob.pixel_x = 13
|
L.pixel_y = 7
|
||||||
buckled_mob.pixel_y = 7
|
if(WEST)
|
||||||
if(NORTH)
|
L.pixel_x = 13
|
||||||
buckled_mob.pixel_x = 0
|
L.pixel_y = 7
|
||||||
buckled_mob.pixel_y = 4
|
if(NORTH)
|
||||||
if(EAST)
|
L.pixel_x = 0
|
||||||
buckled_mob.pixel_x = -13
|
L.pixel_y = 4
|
||||||
buckled_mob.pixel_y = 7
|
if(EAST)
|
||||||
|
L.pixel_x = -13
|
||||||
|
L.pixel_y = 7
|
||||||
|
|
||||||
|
|
||||||
/obj/structure/bed/chair/janicart/bullet_act(var/obj/item/projectile/Proj)
|
/obj/structure/bed/chair/janicart/bullet_act(var/obj/item/projectile/Proj)
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
if(prob(85))
|
if(prob(85))
|
||||||
return buckled_mob.bullet_act(Proj)
|
var/mob/living/L = pick(buckled_mobs)
|
||||||
|
return L.bullet_act(Proj)
|
||||||
visible_message("<span class='warning'>[Proj] ricochets off the [callme]!</span>")
|
visible_message("<span class='warning'>[Proj] ricochets off the [callme]!</span>")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -192,10 +192,10 @@
|
|||||||
..(newloc, "diamond")
|
..(newloc, "diamond")
|
||||||
|
|
||||||
/obj/structure/simple_door/wood/New(var/newloc,var/material_name)
|
/obj/structure/simple_door/wood/New(var/newloc,var/material_name)
|
||||||
..(newloc, "wood")
|
..(newloc, MAT_WOOD)
|
||||||
|
|
||||||
/obj/structure/simple_door/sifwood/New(var/newloc,var/material_name)
|
/obj/structure/simple_door/sifwood/New(var/newloc,var/material_name)
|
||||||
..(newloc, "alien wood")
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
/obj/structure/simple_door/resin/New(var/newloc,var/material_name)
|
/obj/structure/simple_door/resin/New(var/newloc,var/material_name)
|
||||||
..(newloc, "resin")
|
..(newloc, "resin")
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
/obj/structure/bed/nest/update_icon()
|
/obj/structure/bed/nest/update_icon()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/structure/bed/nest/user_unbuckle_mob(mob/user as mob)
|
/obj/structure/bed/nest/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
|
||||||
if(buckled_mob)
|
if(buckled_mob)
|
||||||
if(buckled_mob.buckled == src)
|
if(buckled_mob.buckled == src)
|
||||||
if(buckled_mob != user)
|
if(buckled_mob != user)
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"<span class='notice'>You hear squelching...</span>")
|
"<span class='notice'>You hear squelching...</span>")
|
||||||
buckled_mob.pixel_y = 0
|
buckled_mob.pixel_y = 0
|
||||||
buckled_mob.old_y = 0
|
buckled_mob.old_y = 0
|
||||||
unbuckle_mob()
|
unbuckle_mob(buckled_mob)
|
||||||
else
|
else
|
||||||
if(world.time <= buckled_mob.last_special+NEST_RESIST_TIME)
|
if(world.time <= buckled_mob.last_special+NEST_RESIST_TIME)
|
||||||
return
|
return
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
buckled_mob.last_special = world.time
|
buckled_mob.last_special = world.time
|
||||||
buckled_mob.pixel_y = 0
|
buckled_mob.pixel_y = 0
|
||||||
buckled_mob.old_y = 0
|
buckled_mob.old_y = 0
|
||||||
unbuckle_mob()
|
unbuckle_mob(buckled_mob)
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
M.update_canmove()
|
M.update_canmove()
|
||||||
M.pixel_y = 6
|
M.pixel_y = 6
|
||||||
M.old_y = 6
|
M.old_y = 6
|
||||||
src.buckled_mob = M
|
src.buckled_mobs |= M
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
else if(istype(W, /obj/item/weapon/grab))
|
else if(istype(W, /obj/item/weapon/grab))
|
||||||
var/obj/item/weapon/grab/G = W
|
var/obj/item/weapon/grab/G = W
|
||||||
var/mob/living/affecting = G.affecting
|
var/mob/living/affecting = G.affecting
|
||||||
if(buckled_mob) //Handles trying to buckle someone else to a chair when someone else is on it
|
if(has_buckled_mobs()) //Handles trying to buckle someone else to a chair when someone else is on it
|
||||||
to_chat(user, "<span class='notice'>\The [src] already has someone buckled to it.</span>")
|
to_chat(user, "<span class='notice'>\The [src] already has someone buckled to it.</span>")
|
||||||
return
|
return
|
||||||
user.visible_message("<span class='notice'>[user] attempts to buckle [affecting] into \the [src]!</span>")
|
user.visible_message("<span class='notice'>[user] attempts to buckle [affecting] into \the [src]!</span>")
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
..(newloc,"wood","cotton")
|
..(newloc,"wood","cotton")
|
||||||
|
|
||||||
/obj/structure/bed/double/post_buckle_mob(mob/living/M as mob)
|
/obj/structure/bed/double/post_buckle_mob(mob/living/M as mob)
|
||||||
if(M == buckled_mob)
|
if(M.buckled == src)
|
||||||
M.pixel_y = 13
|
M.pixel_y = 13
|
||||||
M.old_y = 13
|
M.old_y = 13
|
||||||
else
|
else
|
||||||
@@ -216,8 +216,9 @@
|
|||||||
if(istype(W, /obj/item/weapon/wrench) || istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
if(istype(W, /obj/item/weapon/wrench) || istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
||||||
return
|
return
|
||||||
else if(istype(W,/obj/item/roller_holder))
|
else if(istype(W,/obj/item/roller_holder))
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
user_unbuckle_mob(user)
|
for(var/A in buckled_mobs)
|
||||||
|
user_unbuckle_mob(A, user)
|
||||||
else
|
else
|
||||||
visible_message("[user] collapses \the [src.name].")
|
visible_message("[user] collapses \the [src.name].")
|
||||||
new rollertype(get_turf(src))
|
new rollertype(get_turf(src))
|
||||||
@@ -287,14 +288,15 @@
|
|||||||
|
|
||||||
/obj/structure/bed/roller/Move()
|
/obj/structure/bed/roller/Move()
|
||||||
..()
|
..()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
if(buckled_mob.buckled == src)
|
for(var/A in buckled_mobs)
|
||||||
buckled_mob.loc = src.loc
|
var/mob/living/L = A
|
||||||
else
|
|
||||||
buckled_mob = null
|
if(L.buckled == src)
|
||||||
|
L.loc = src.loc
|
||||||
|
|
||||||
/obj/structure/bed/roller/post_buckle_mob(mob/living/M as mob)
|
/obj/structure/bed/roller/post_buckle_mob(mob/living/M as mob)
|
||||||
if(M == buckled_mob)
|
if(M.buckled == src)
|
||||||
M.pixel_y = 6
|
M.pixel_y = 6
|
||||||
M.old_y = 6
|
M.old_y = 6
|
||||||
density = 1
|
density = 1
|
||||||
@@ -311,7 +313,7 @@
|
|||||||
..()
|
..()
|
||||||
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
|
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
|
||||||
if(!ishuman(usr)) return
|
if(!ishuman(usr)) return
|
||||||
if(buckled_mob) return 0
|
if(has_buckled_mobs()) return 0
|
||||||
visible_message("[usr] collapses \the [src.name].")
|
visible_message("[usr] collapses \the [src.name].")
|
||||||
new rollertype(get_turf(src))
|
new rollertype(get_turf(src))
|
||||||
spawn(0)
|
spawn(0)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/obj/structure/bed/chair/attack_tk(mob/user as mob)
|
/obj/structure/bed/chair/attack_tk(mob/user as mob)
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
..()
|
..()
|
||||||
else
|
else
|
||||||
rotate()
|
rotate()
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
/obj/structure/bed/chair/update_icon()
|
/obj/structure/bed/chair/update_icon()
|
||||||
..()
|
..()
|
||||||
if(buckled_mob && padding_material)
|
if(has_buckled_mobs() && padding_material)
|
||||||
var/cache_key = "[base_icon]-armrest-[padding_material.name]"
|
var/cache_key = "[base_icon]-armrest-[padding_material.name]"
|
||||||
if(isnull(stool_cache[cache_key]))
|
if(isnull(stool_cache[cache_key]))
|
||||||
var/image/I = image(icon, "[base_icon]_armrest")
|
var/image/I = image(icon, "[base_icon]_armrest")
|
||||||
@@ -60,8 +60,10 @@
|
|||||||
/obj/structure/bed/chair/set_dir()
|
/obj/structure/bed/chair/set_dir()
|
||||||
..()
|
..()
|
||||||
update_layer()
|
update_layer()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
buckled_mob.set_dir(dir)
|
for(var/A in buckled_mobs)
|
||||||
|
var/mob/living/L = A
|
||||||
|
L.set_dir(dir)
|
||||||
|
|
||||||
/obj/structure/bed/chair/verb/rotate()
|
/obj/structure/bed/chair/verb/rotate()
|
||||||
set name = "Rotate Chair"
|
set name = "Rotate Chair"
|
||||||
@@ -136,45 +138,47 @@
|
|||||||
|
|
||||||
/obj/structure/bed/chair/office/Move()
|
/obj/structure/bed/chair/office/Move()
|
||||||
..()
|
..()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
var/mob/living/occupant = buckled_mob
|
for(var/A in buckled_mobs)
|
||||||
occupant.buckled = null
|
var/mob/living/occupant = A
|
||||||
occupant.Move(src.loc)
|
occupant.buckled = null
|
||||||
occupant.buckled = src
|
occupant.Move(src.loc)
|
||||||
if (occupant && (src.loc != occupant.loc))
|
occupant.buckled = src
|
||||||
if (propelled)
|
if (occupant && (src.loc != occupant.loc))
|
||||||
for (var/mob/O in src.loc)
|
if (propelled)
|
||||||
if (O != occupant)
|
for (var/mob/O in src.loc)
|
||||||
Bump(O)
|
if (O != occupant)
|
||||||
else
|
Bump(O)
|
||||||
unbuckle_mob()
|
else
|
||||||
|
unbuckle_mob()
|
||||||
|
|
||||||
/obj/structure/bed/chair/office/Bump(atom/A)
|
/obj/structure/bed/chair/office/Bump(atom/A)
|
||||||
..()
|
..()
|
||||||
if(!buckled_mob) return
|
if(!has_buckled_mobs()) return
|
||||||
|
|
||||||
if(propelled)
|
if(propelled)
|
||||||
var/mob/living/occupant = unbuckle_mob()
|
for(var/a in buckled_mobs)
|
||||||
|
var/mob/living/occupant = unbuckle_mob(a)
|
||||||
|
|
||||||
var/def_zone = ran_zone()
|
var/def_zone = ran_zone()
|
||||||
var/blocked = occupant.run_armor_check(def_zone, "melee")
|
var/blocked = occupant.run_armor_check(def_zone, "melee")
|
||||||
var/soaked = occupant.get_armor_soak(def_zone, "melee")
|
var/soaked = occupant.get_armor_soak(def_zone, "melee")
|
||||||
occupant.throw_at(A, 3, propelled)
|
occupant.throw_at(A, 3, propelled)
|
||||||
occupant.apply_effect(6, STUN, blocked)
|
occupant.apply_effect(6, STUN, blocked)
|
||||||
occupant.apply_effect(6, WEAKEN, blocked)
|
occupant.apply_effect(6, WEAKEN, blocked)
|
||||||
occupant.apply_effect(6, STUTTER, blocked)
|
occupant.apply_effect(6, STUTTER, blocked)
|
||||||
occupant.apply_damage(10, BRUTE, def_zone, blocked, soaked)
|
occupant.apply_damage(10, BRUTE, def_zone, blocked, soaked)
|
||||||
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
|
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
|
||||||
if(istype(A, /mob/living))
|
if(istype(A, /mob/living))
|
||||||
var/mob/living/victim = A
|
var/mob/living/victim = A
|
||||||
def_zone = ran_zone()
|
def_zone = ran_zone()
|
||||||
blocked = victim.run_armor_check(def_zone, "melee")
|
blocked = victim.run_armor_check(def_zone, "melee")
|
||||||
soaked = victim.get_armor_soak(def_zone, "melee")
|
soaked = victim.get_armor_soak(def_zone, "melee")
|
||||||
victim.apply_effect(6, STUN, blocked)
|
victim.apply_effect(6, STUN, blocked)
|
||||||
victim.apply_effect(6, WEAKEN, blocked)
|
victim.apply_effect(6, WEAKEN, blocked)
|
||||||
victim.apply_effect(6, STUTTER, blocked)
|
victim.apply_effect(6, STUTTER, blocked)
|
||||||
victim.apply_damage(10, BRUTE, def_zone, blocked, soaked)
|
victim.apply_damage(10, BRUTE, def_zone, blocked, soaked)
|
||||||
occupant.visible_message("<span class='danger'>[occupant] crashed into \the [A]!</span>")
|
occupant.visible_message("<span class='danger'>[occupant] crashed into \the [A]!</span>")
|
||||||
|
|
||||||
/obj/structure/bed/chair/office/light
|
/obj/structure/bed/chair/office/light
|
||||||
icon_state = "officechair_white"
|
icon_state = "officechair_white"
|
||||||
|
|||||||
@@ -17,8 +17,10 @@
|
|||||||
overlays = null
|
overlays = null
|
||||||
var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir)
|
var/image/O = image(icon = 'icons/obj/furniture.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir)
|
||||||
overlays += O
|
overlays += O
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
buckled_mob.set_dir(dir)
|
for(var/A in buckled_mobs)
|
||||||
|
var/mob/living/L = A
|
||||||
|
L.set_dir(dir)
|
||||||
|
|
||||||
/obj/structure/bed/chair/wheelchair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/structure/bed/chair/wheelchair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
if(istype(W, /obj/item/weapon/wrench) || istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
if(istype(W, /obj/item/weapon/wrench) || istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
||||||
@@ -33,7 +35,7 @@
|
|||||||
user.pulledby = null
|
user.pulledby = null
|
||||||
user << "<span class='warning'>You lost your grip!</span>"
|
user << "<span class='warning'>You lost your grip!</span>"
|
||||||
return
|
return
|
||||||
if(buckled_mob && pulling && user == buckled_mob)
|
if(has_buckled_mobs() && pulling && user in buckled_mobs)
|
||||||
if(pulling.stat || pulling.stunned || pulling.weakened || pulling.paralysis || pulling.lying || pulling.restrained())
|
if(pulling.stat || pulling.stunned || pulling.weakened || pulling.paralysis || pulling.lying || pulling.restrained())
|
||||||
pulling.pulledby = null
|
pulling.pulledby = null
|
||||||
pulling = null
|
pulling = null
|
||||||
@@ -51,7 +53,7 @@
|
|||||||
if(pulling && (get_dir(src.loc, pulling.loc) == direction))
|
if(pulling && (get_dir(src.loc, pulling.loc) == direction))
|
||||||
user << "<span class='warning'>You cannot go there.</span>"
|
user << "<span class='warning'>You cannot go there.</span>"
|
||||||
return
|
return
|
||||||
if(pulling && buckled_mob && (buckled_mob == user))
|
if(pulling && has_buckled_mobs() && (user in buckled_mobs))
|
||||||
user << "<span class='warning'>You cannot drive while being pushed.</span>"
|
user << "<span class='warning'>You cannot drive while being pushed.</span>"
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -59,10 +61,12 @@
|
|||||||
driving = 1
|
driving = 1
|
||||||
var/turf/T = null
|
var/turf/T = null
|
||||||
//--1---Move occupant---1--//
|
//--1---Move occupant---1--//
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
buckled_mob.buckled = null
|
for(var/A in buckled_mobs)
|
||||||
step(buckled_mob, direction)
|
var/mob/living/L = A
|
||||||
buckled_mob.buckled = src
|
L.buckled = null
|
||||||
|
step(L, direction)
|
||||||
|
L.buckled = src
|
||||||
//--2----Move driver----2--//
|
//--2----Move driver----2--//
|
||||||
if(pulling)
|
if(pulling)
|
||||||
T = pulling.loc
|
T = pulling.loc
|
||||||
@@ -70,8 +74,9 @@
|
|||||||
step(pulling, get_dir(pulling.loc, src.loc))
|
step(pulling, get_dir(pulling.loc, src.loc))
|
||||||
//--3--Move wheelchair--3--//
|
//--3--Move wheelchair--3--//
|
||||||
step(src, direction)
|
step(src, direction)
|
||||||
if(buckled_mob) // Make sure it stays beneath the occupant
|
if(has_buckled_mobs()) // Make sure it stays beneath the occupant
|
||||||
Move(buckled_mob.loc)
|
var/mob/living/L = buckled_mobs[1]
|
||||||
|
Move(L.loc)
|
||||||
set_dir(direction)
|
set_dir(direction)
|
||||||
if(pulling) // Driver
|
if(pulling) // Driver
|
||||||
if(pulling.loc == src.loc) // We moved onto the wheelchair? Revert!
|
if(pulling.loc == src.loc) // We moved onto the wheelchair? Revert!
|
||||||
@@ -88,38 +93,41 @@
|
|||||||
|
|
||||||
/obj/structure/bed/chair/wheelchair/Move()
|
/obj/structure/bed/chair/wheelchair/Move()
|
||||||
..()
|
..()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
var/mob/living/occupant = buckled_mob
|
for(var/A in buckled_mobs)
|
||||||
if(!driving)
|
var/mob/living/occupant = A
|
||||||
occupant.buckled = null
|
if(!driving)
|
||||||
occupant.Move(src.loc)
|
occupant.buckled = null
|
||||||
occupant.buckled = src
|
occupant.Move(src.loc)
|
||||||
if (occupant && (src.loc != occupant.loc))
|
occupant.buckled = src
|
||||||
if (propelled)
|
if (occupant && (src.loc != occupant.loc))
|
||||||
for (var/mob/O in src.loc)
|
if (propelled)
|
||||||
if (O != occupant)
|
for (var/mob/O in src.loc)
|
||||||
Bump(O)
|
if (O != occupant)
|
||||||
else
|
Bump(O)
|
||||||
unbuckle_mob()
|
else
|
||||||
if (pulling && (get_dist(src, pulling) > 1))
|
unbuckle_mob()
|
||||||
pulling.pulledby = null
|
if (pulling && (get_dist(src, pulling) > 1))
|
||||||
pulling << "<span class='warning'>You lost your grip!</span>"
|
pulling.pulledby = null
|
||||||
pulling = null
|
pulling << "<span class='warning'>You lost your grip!</span>"
|
||||||
else
|
pulling = null
|
||||||
if (occupant && (src.loc != occupant.loc))
|
else
|
||||||
src.forceMove(occupant.loc) // Failsafe to make sure the wheelchair stays beneath the occupant after driving
|
if (occupant && (src.loc != occupant.loc))
|
||||||
|
src.forceMove(occupant.loc) // Failsafe to make sure the wheelchair stays beneath the occupant after driving
|
||||||
|
|
||||||
/obj/structure/bed/chair/wheelchair/attack_hand(mob/living/user as mob)
|
/obj/structure/bed/chair/wheelchair/attack_hand(mob/living/user as mob)
|
||||||
if (pulling)
|
if (pulling)
|
||||||
MouseDrop(usr)
|
MouseDrop(usr)
|
||||||
else
|
else
|
||||||
user_unbuckle_mob(user)
|
if(has_buckled_mobs())
|
||||||
|
for(var/A in buckled_mobs)
|
||||||
|
user_unbuckle_mob(A, user)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/structure/bed/chair/wheelchair/CtrlClick(var/mob/user)
|
/obj/structure/bed/chair/wheelchair/CtrlClick(var/mob/user)
|
||||||
if(in_range(src, user))
|
if(in_range(src, user))
|
||||||
if(!ishuman(user)) return
|
if(!ishuman(user)) return
|
||||||
if(user == buckled_mob)
|
if(has_buckled_mobs() && user in buckled_mobs)
|
||||||
user << "<span class='warning'>You realize you are unable to push the wheelchair you sit in.</span>"
|
user << "<span class='warning'>You realize you are unable to push the wheelchair you sit in.</span>"
|
||||||
return
|
return
|
||||||
if(!pulling)
|
if(!pulling)
|
||||||
@@ -137,7 +145,7 @@
|
|||||||
|
|
||||||
/obj/structure/bed/chair/wheelchair/Bump(atom/A)
|
/obj/structure/bed/chair/wheelchair/Bump(atom/A)
|
||||||
..()
|
..()
|
||||||
if(!buckled_mob) return
|
if(!has_buckled_mobs()) return
|
||||||
|
|
||||||
if(propelled || (pulling && (pulling.a_intent == I_HURT)))
|
if(propelled || (pulling && (pulling.a_intent == I_HURT)))
|
||||||
var/mob/living/occupant = unbuckle_mob()
|
var/mob/living/occupant = unbuckle_mob()
|
||||||
@@ -213,7 +221,7 @@
|
|||||||
..()
|
..()
|
||||||
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
|
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
|
||||||
if(!ishuman(usr)) return
|
if(!ishuman(usr)) return
|
||||||
if(buckled_mob) return 0
|
if(has_buckled_mobs()) return 0
|
||||||
visible_message("[usr] collapses \the [src.name].")
|
visible_message("[usr] collapses \the [src.name].")
|
||||||
var/obj/item/wheelchair/R = new/obj/item/wheelchair(get_turf(src))
|
var/obj/item/wheelchair/R = new/obj/item/wheelchair(get_turf(src))
|
||||||
R.name = src.name
|
R.name = src.name
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ var/list/mechtoys = list(
|
|||||||
return prob(60)
|
return prob(60)
|
||||||
|
|
||||||
var/obj/structure/bed/B = A
|
var/obj/structure/bed/B = A
|
||||||
if (istype(A, /obj/structure/bed) && B.buckled_mob)//if it's a bed/chair and someone is buckled, it will not pass
|
if (istype(A, /obj/structure/bed) && B.has_buckled_mobs())//if it's a bed/chair and someone is buckled, it will not pass
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(istype(A, /obj/vehicle)) //no vehicles
|
if(istype(A, /obj/vehicle)) //no vehicles
|
||||||
|
|||||||
@@ -48,16 +48,16 @@
|
|||||||
..(newloc,"durasteel", "durasteel")
|
..(newloc,"durasteel", "durasteel")
|
||||||
|
|
||||||
/turf/simulated/wall/wood/New(var/newloc)
|
/turf/simulated/wall/wood/New(var/newloc)
|
||||||
..(newloc,"wood")
|
..(newloc, MAT_WOOD)
|
||||||
|
|
||||||
/turf/simulated/wall/sifwood/New(var/newloc)
|
/turf/simulated/wall/sifwood/New(var/newloc)
|
||||||
..(newloc,"alien wood")
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
/turf/simulated/wall/log/New(var/newloc)
|
/turf/simulated/wall/log/New(var/newloc)
|
||||||
..(newloc,"log")
|
..(newloc, MAT_LOG)
|
||||||
|
|
||||||
/turf/simulated/wall/log_sif/New(var/newloc)
|
/turf/simulated/wall/log_sif/New(var/newloc)
|
||||||
..(newloc,"alien log")
|
..(newloc, MAT_SIFLOG)
|
||||||
|
|
||||||
// Shuttle Walls
|
// Shuttle Walls
|
||||||
/turf/simulated/shuttle/wall
|
/turf/simulated/shuttle/wall
|
||||||
|
|||||||
@@ -55,6 +55,8 @@
|
|||||||
if(istype(AM, /mob/living))
|
if(istype(AM, /mob/living))
|
||||||
var/mob/living/L = AM
|
var/mob/living/L = AM
|
||||||
L.update_water()
|
L.update_water()
|
||||||
|
if(L.check_submerged() <= 0)
|
||||||
|
return
|
||||||
if(!istype(oldloc, /turf/simulated/floor/water))
|
if(!istype(oldloc, /turf/simulated/floor/water))
|
||||||
to_chat(L, "<span class='warning'>You get drenched in water from entering \the [src]!</span>")
|
to_chat(L, "<span class='warning'>You get drenched in water from entering \the [src]!</span>")
|
||||||
AM.water_act(5)
|
AM.water_act(5)
|
||||||
@@ -64,6 +66,8 @@
|
|||||||
if(istype(AM, /mob/living))
|
if(istype(AM, /mob/living))
|
||||||
var/mob/living/L = AM
|
var/mob/living/L = AM
|
||||||
L.update_water()
|
L.update_water()
|
||||||
|
if(L.check_submerged() <= 0)
|
||||||
|
return
|
||||||
if(!istype(newloc, /turf/simulated/floor/water))
|
if(!istype(newloc, /turf/simulated/floor/water))
|
||||||
to_chat(L, "<span class='warning'>You climb out of \the [src].</span>")
|
to_chat(L, "<span class='warning'>You climb out of \the [src].</span>")
|
||||||
..()
|
..()
|
||||||
@@ -97,6 +101,8 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/mob/living/proc/check_submerged()
|
/mob/living/proc/check_submerged()
|
||||||
|
if(buckled)
|
||||||
|
return 0
|
||||||
var/turf/simulated/floor/water/T = loc
|
var/turf/simulated/floor/water/T = loc
|
||||||
if(istype(T))
|
if(istype(T))
|
||||||
return T.depth
|
return T.depth
|
||||||
|
|||||||
@@ -73,10 +73,12 @@
|
|||||||
else
|
else
|
||||||
plant.layer = layer + 0.1
|
plant.layer = layer + 0.1
|
||||||
|
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
seed.do_sting(buckled_mob,src)
|
for(var/A in buckled_mobs)
|
||||||
if(seed.get_trait(TRAIT_CARNIVOROUS))
|
var/mob/living/L = A
|
||||||
seed.do_thorns(buckled_mob,src)
|
seed.do_sting(L,src)
|
||||||
|
if(seed.get_trait(TRAIT_CARNIVOROUS))
|
||||||
|
seed.do_thorns(L,src)
|
||||||
|
|
||||||
if(world.time >= last_tick+NEIGHBOR_REFRESH_TIME)
|
if(world.time >= last_tick+NEIGHBOR_REFRESH_TIME)
|
||||||
last_tick = world.time
|
last_tick = world.time
|
||||||
@@ -88,7 +90,7 @@
|
|||||||
if(prob(chance))
|
if(prob(chance))
|
||||||
sampled = 0
|
sampled = 0
|
||||||
|
|
||||||
if(is_mature() && !buckled_mob)
|
if(is_mature() && !has_buckled_mobs())
|
||||||
for(var/turf/neighbor in neighbors)
|
for(var/turf/neighbor in neighbors)
|
||||||
for(var/mob/living/M in neighbor)
|
for(var/mob/living/M in neighbor)
|
||||||
if(seed.get_trait(TRAIT_SPREAD) >= 2 && (M.lying || prob(round(seed.get_trait(TRAIT_POTENCY)))))
|
if(seed.get_trait(TRAIT_SPREAD) >= 2 && (M.lying || prob(round(seed.get_trait(TRAIT_POTENCY)))))
|
||||||
@@ -107,7 +109,7 @@
|
|||||||
|
|
||||||
// We shouldn't have spawned if the controller doesn't exist.
|
// We shouldn't have spawned if the controller doesn't exist.
|
||||||
check_health()
|
check_health()
|
||||||
if(buckled_mob || neighbors.len)
|
if(has_buckled_mobs() || neighbors.len)
|
||||||
plant_controller.add_plant(src)
|
plant_controller.add_plant(src)
|
||||||
|
|
||||||
//spreading vines aren't created on their final turf.
|
//spreading vines aren't created on their final turf.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
if(!istype(M))
|
if(!istype(M))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!buckled_mob && !M.buckled && !M.anchored && (issmall(M) || prob(round(seed.get_trait(TRAIT_POTENCY)/3))))
|
if(!has_buckled_mobs() && !M.buckled && !M.anchored && (issmall(M) || prob(round(seed.get_trait(TRAIT_POTENCY)/3))))
|
||||||
//wait a tick for the Entered() proc that called HasProximity() to finish (and thus the moving animation),
|
//wait a tick for the Entered() proc that called HasProximity() to finish (and thus the moving animation),
|
||||||
//so we don't appear to teleport from two tiles away when moving into a turf adjacent to vines.
|
//so we don't appear to teleport from two tiles away when moving into a turf adjacent to vines.
|
||||||
spawn(1)
|
spawn(1)
|
||||||
@@ -35,31 +35,35 @@
|
|||||||
seed.do_sting(victim,src,pick("r_foot","l_foot","r_leg","l_leg"))
|
seed.do_sting(victim,src,pick("r_foot","l_foot","r_leg","l_leg"))
|
||||||
|
|
||||||
/obj/effect/plant/proc/unbuckle()
|
/obj/effect/plant/proc/unbuckle()
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
if(buckled_mob.buckled == src)
|
for(var/A in buckled_mobs)
|
||||||
buckled_mob.buckled = null
|
var/mob/living/L = A
|
||||||
buckled_mob.anchored = initial(buckled_mob.anchored)
|
if(L.buckled == src)
|
||||||
buckled_mob.update_canmove()
|
L.buckled = null
|
||||||
buckled_mob = null
|
L.anchored = initial(L.anchored)
|
||||||
|
L.update_canmove()
|
||||||
|
buckled_mobs = list()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/effect/plant/proc/manual_unbuckle(mob/user as mob)
|
/obj/effect/plant/proc/manual_unbuckle(mob/user as mob)
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
var/chance = 20
|
var/chance = 20
|
||||||
if(seed)
|
if(seed)
|
||||||
chance = round(100/(20*seed.get_trait(TRAIT_POTENCY)/100))
|
chance = round(100/(20*seed.get_trait(TRAIT_POTENCY)/100))
|
||||||
if(prob(chance))
|
if(prob(chance))
|
||||||
if(buckled_mob != user)
|
for(var/A in buckled_mobs)
|
||||||
buckled_mob.visible_message(\
|
var/mob/living/L = A
|
||||||
"<span class='notice'>\The [user] frees \the [buckled_mob] from \the [src].</span>",\
|
if(!(user in buckled_mobs))
|
||||||
"<span class='notice'>\The [user] frees you from \the [src].</span>",\
|
L.visible_message(\
|
||||||
"<span class='warning'>You hear shredding and ripping.</span>")
|
"<span class='notice'>\The [user] frees \the [L] from \the [src].</span>",\
|
||||||
else
|
"<span class='notice'>\The [user] frees you from \the [src].</span>",\
|
||||||
buckled_mob.visible_message(\
|
"<span class='warning'>You hear shredding and ripping.</span>")
|
||||||
"<span class='notice'>\The [buckled_mob] struggles free of \the [src].</span>",\
|
else
|
||||||
"<span class='notice'>You untangle \the [src] from around yourself.</span>",\
|
L.visible_message(\
|
||||||
"<span class='warning'>You hear shredding and ripping.</span>")
|
"<span class='notice'>\The [L] struggles free of \the [src].</span>",\
|
||||||
unbuckle()
|
"<span class='notice'>You untangle \the [src] from around yourself.</span>",\
|
||||||
|
"<span class='warning'>You hear shredding and ripping.</span>")
|
||||||
|
unbuckle()
|
||||||
else
|
else
|
||||||
user.setClickCooldown(user.get_attack_speed())
|
user.setClickCooldown(user.get_attack_speed())
|
||||||
health -= rand(1,5)
|
health -= rand(1,5)
|
||||||
@@ -73,7 +77,7 @@
|
|||||||
|
|
||||||
/obj/effect/plant/proc/entangle(var/mob/living/victim)
|
/obj/effect/plant/proc/entangle(var/mob/living/victim)
|
||||||
|
|
||||||
if(buckled_mob)
|
if(has_buckled_mobs())
|
||||||
return
|
return
|
||||||
|
|
||||||
if(victim.buckled || victim.anchored)
|
if(victim.buckled || victim.anchored)
|
||||||
|
|||||||
@@ -125,6 +125,9 @@
|
|||||||
|
|
||||||
/material/wood/generate_recipes()
|
/material/wood/generate_recipes()
|
||||||
..()
|
..()
|
||||||
|
recipes += new/datum/stack_recipe("oar", /obj/item/weapon/oar, 2, time = 30, supplied_material = "[name]")
|
||||||
|
recipes += new/datum/stack_recipe("boat", /obj/vehicle/boat, 20, time = 10 SECONDS, supplied_material = "[name]")
|
||||||
|
recipes += new/datum/stack_recipe("dragon boat", /obj/vehicle/boat/dragon, 50, time = 30 SECONDS, supplied_material = "[name]")
|
||||||
recipes += new/datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1)
|
recipes += new/datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1)
|
||||||
recipes += new/datum/stack_recipe("wood circlet", /obj/item/clothing/head/woodcirclet, 1)
|
recipes += new/datum/stack_recipe("wood circlet", /obj/item/clothing/head/woodcirclet, 1)
|
||||||
recipes += new/datum/stack_recipe("clipboard", /obj/item/weapon/clipboard, 1)
|
recipes += new/datum/stack_recipe("clipboard", /obj/item/weapon/clipboard, 1)
|
||||||
|
|||||||
@@ -201,33 +201,48 @@
|
|||||||
/obj/item/stack/material/wood
|
/obj/item/stack/material/wood
|
||||||
name = "wooden plank"
|
name = "wooden plank"
|
||||||
icon_state = "sheet-wood"
|
icon_state = "sheet-wood"
|
||||||
default_type = "wood"
|
default_type = MAT_WOOD
|
||||||
|
|
||||||
|
/obj/item/stack/material/wood/sif
|
||||||
|
name = "alien wooden plank"
|
||||||
|
color = "#0099cc"
|
||||||
|
default_type = MAT_SIFWOOD
|
||||||
|
|
||||||
/obj/item/stack/material/log
|
/obj/item/stack/material/log
|
||||||
name = "log"
|
name = "log"
|
||||||
icon_state = "sheet-log"
|
icon_state = "sheet-log"
|
||||||
default_type = "log"
|
default_type = MAT_LOG
|
||||||
no_variants = FALSE
|
no_variants = FALSE
|
||||||
color = "#824B28"
|
color = "#824B28"
|
||||||
max_amount = 25
|
max_amount = 25
|
||||||
w_class = ITEMSIZE_HUGE
|
w_class = ITEMSIZE_HUGE
|
||||||
|
description_info = "Use inhand to craft things, or use a sharp and edged object on this to convert it into two wooden planks."
|
||||||
|
var/plank_type = /obj/item/stack/material/wood
|
||||||
|
|
||||||
/obj/item/stack/material/log/sif
|
/obj/item/stack/material/log/sif
|
||||||
name = "alien log"
|
name = "alien log"
|
||||||
default_type = "alien log"
|
default_type = MAT_SIFLOG
|
||||||
color = "#0099cc"
|
color = "#0099cc"
|
||||||
|
plank_type = /obj/item/stack/material/wood/sif
|
||||||
|
|
||||||
/obj/item/stack/material/log/attackby(var/obj/item/W, var/mob/user)
|
/obj/item/stack/material/log/attackby(var/obj/item/W, var/mob/user)
|
||||||
if(!istype(W))
|
if(!istype(W) || W.force <= 0)
|
||||||
return ..()
|
return ..()
|
||||||
if(W.sharp && W.edge && use(1))
|
if(W.sharp && W.edge)
|
||||||
to_chat(user, "<span class='notice'>You cut up a log into planks.</span>")
|
var/time = (3 SECONDS / max(W.force / 10, 1)) * W.toolspeed
|
||||||
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
|
user.setClickCooldown(time)
|
||||||
var/obj/item/stack/material/wood/existing_wood = locate() in user.loc
|
if(do_after(user, time, src) && use(1))
|
||||||
var/obj/item/stack/material/wood/new_wood = new(user.loc)
|
to_chat(user, "<span class='notice'>You cut up a log into planks.</span>")
|
||||||
new_wood.amount = 2
|
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
|
||||||
if(existing_wood)
|
var/obj/item/stack/material/wood/existing_wood = null
|
||||||
if(new_wood.transfer_to(existing_wood))
|
for(var/obj/item/stack/material/wood/M in user.loc)
|
||||||
|
if(M.material.name == src.material.name)
|
||||||
|
existing_wood = M
|
||||||
|
break
|
||||||
|
|
||||||
|
var/obj/item/stack/material/wood/new_wood = new plank_type(user.loc)
|
||||||
|
new_wood.amount = 2
|
||||||
|
if(existing_wood && new_wood.transfer_to(existing_wood))
|
||||||
to_chat(user, "<span class='notice'>You add the newly-formed wood to the stack. It now contains [existing_wood.amount] planks.</span>")
|
to_chat(user, "<span class='notice'>You add the newly-formed wood to the stack. It now contains [existing_wood.amount] planks.</span>")
|
||||||
else
|
else
|
||||||
return ..()
|
return ..()
|
||||||
|
|||||||
@@ -672,9 +672,9 @@ var/list/name_to_material
|
|||||||
|
|
||||||
|
|
||||||
/material/wood
|
/material/wood
|
||||||
name = "wood"
|
name = MAT_WOOD
|
||||||
stack_type = /obj/item/stack/material/wood
|
stack_type = /obj/item/stack/material/wood
|
||||||
icon_colour = "#824B28"
|
icon_colour = "#9c5930"
|
||||||
integrity = 50
|
integrity = 50
|
||||||
icon_base = "wood"
|
icon_base = "wood"
|
||||||
explosion_resistance = 2
|
explosion_resistance = 2
|
||||||
@@ -694,14 +694,14 @@ var/list/name_to_material
|
|||||||
sheet_plural_name = "planks"
|
sheet_plural_name = "planks"
|
||||||
|
|
||||||
/material/wood/log
|
/material/wood/log
|
||||||
name = "log"
|
name = MAT_LOG
|
||||||
icon_base = "log"
|
icon_base = "log"
|
||||||
stack_type = /obj/item/stack/material/log
|
stack_type = /obj/item/stack/material/log
|
||||||
sheet_singular_name = null
|
sheet_singular_name = null
|
||||||
sheet_plural_name = "pile"
|
sheet_plural_name = "pile"
|
||||||
|
|
||||||
/material/wood/log/sif
|
/material/wood/log/sif
|
||||||
name = "alien log"
|
name = MAT_SIFLOG
|
||||||
icon_colour = "#0099cc" // Cyan-ish
|
icon_colour = "#0099cc" // Cyan-ish
|
||||||
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2)
|
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2)
|
||||||
stack_type = /obj/item/stack/material/log/sif
|
stack_type = /obj/item/stack/material/log/sif
|
||||||
@@ -713,7 +713,7 @@ var/list/name_to_material
|
|||||||
shard_type = SHARD_NONE
|
shard_type = SHARD_NONE
|
||||||
|
|
||||||
/material/wood/sif
|
/material/wood/sif
|
||||||
name = "alien wood"
|
name = MAT_SIFWOOD
|
||||||
// stack_type = /obj/item/stack/material/wood/sif
|
// stack_type = /obj/item/stack/material/wood/sif
|
||||||
icon_colour = "#0099cc" // Cyan-ish
|
icon_colour = "#0099cc" // Cyan-ish
|
||||||
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2) // Alien wood would presumably be more interesting to the analyzer.
|
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2) // Alien wood would presumably be more interesting to the analyzer.
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ var/list/slot_equipment_priority = list( \
|
|||||||
//Returns the thing in our inactive hand
|
//Returns the thing in our inactive hand
|
||||||
/mob/proc/get_inactive_hand()
|
/mob/proc/get_inactive_hand()
|
||||||
|
|
||||||
|
// Override for your specific mob's hands or lack thereof.
|
||||||
|
/mob/proc/is_holding_item_of_type(typepath)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||||
/mob/proc/put_in_l_hand(var/obj/item/W)
|
/mob/proc/put_in_l_hand(var/obj/item/W)
|
||||||
if(lying || !istype(W))
|
if(lying || !istype(W))
|
||||||
|
|||||||
@@ -352,3 +352,10 @@ This saves us from having to call add_fingerprint() any time something is put in
|
|||||||
if(slot_l_ear) return l_ear
|
if(slot_l_ear) return l_ear
|
||||||
if(slot_r_ear) return r_ear
|
if(slot_r_ear) return r_ear
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
|
|
||||||
|
/mob/living/carbon/human/is_holding_item_of_type(typepath)
|
||||||
|
for(var/obj/item/I in list(l_hand, r_hand))
|
||||||
|
if(istype(I, typepath))
|
||||||
|
return I
|
||||||
|
return FALSE
|
||||||
@@ -175,4 +175,4 @@
|
|||||||
return
|
return
|
||||||
visible_message("<span class='danger'>[usr] manages to unbuckle themself!</span>",
|
visible_message("<span class='danger'>[usr] manages to unbuckle themself!</span>",
|
||||||
"<span class='notice'>You successfully unbuckle yourself.</span>")
|
"<span class='notice'>You successfully unbuckle yourself.</span>")
|
||||||
buckled.user_unbuckle_mob(src)
|
buckled.user_unbuckle_mob(src, src)
|
||||||
|
|||||||
@@ -822,7 +822,7 @@ default behaviour is:
|
|||||||
|
|
||||||
/mob/living/proc/escape_buckle()
|
/mob/living/proc/escape_buckle()
|
||||||
if(buckled)
|
if(buckled)
|
||||||
buckled.user_unbuckle_mob(src)
|
buckled.user_unbuckle_mob(src, src)
|
||||||
|
|
||||||
/mob/living/proc/resist_grab()
|
/mob/living/proc/resist_grab()
|
||||||
var/resisting = 0
|
var/resisting = 0
|
||||||
@@ -951,11 +951,14 @@ default behaviour is:
|
|||||||
if(is_physically_disabled())
|
if(is_physically_disabled())
|
||||||
lying = 0
|
lying = 0
|
||||||
canmove = 1
|
canmove = 1
|
||||||
pixel_y = V.mob_offset_y - 5
|
if(!V.riding_datum) // If it has a riding datum, the datum handles moving the pixel_ vars.
|
||||||
|
pixel_y = V.mob_offset_y - 5
|
||||||
else
|
else
|
||||||
if(buckled.buckle_lying != -1) lying = buckled.buckle_lying
|
if(buckled.buckle_lying != -1)
|
||||||
|
lying = buckled.buckle_lying
|
||||||
canmove = 1
|
canmove = 1
|
||||||
pixel_y = V.mob_offset_y
|
if(!V.riding_datum) // If it has a riding datum, the datum handles moving the pixel_ vars.
|
||||||
|
pixel_y = V.mob_offset_y
|
||||||
else if(buckled)
|
else if(buckled)
|
||||||
anchored = 1
|
anchored = 1
|
||||||
canmove = 0
|
canmove = 0
|
||||||
|
|||||||
@@ -338,8 +338,9 @@
|
|||||||
weaponlock_time = 120
|
weaponlock_time = 120
|
||||||
|
|
||||||
/mob/living/silicon/robot/update_canmove()
|
/mob/living/silicon/robot/update_canmove()
|
||||||
if(paralysis || stunned || weakened || buckled || lockdown || !is_component_functioning("actuator")) canmove = 0
|
..() // Let's not reinvent the wheel.
|
||||||
else canmove = 1
|
if(lockdown || !is_component_functioning("actuator"))
|
||||||
|
canmove = FALSE
|
||||||
return canmove
|
return canmove
|
||||||
|
|
||||||
/mob/living/silicon/robot/update_fire()
|
/mob/living/silicon/robot/update_fire()
|
||||||
|
|||||||
@@ -44,11 +44,12 @@
|
|||||||
if(istype(L, /mob/living/carbon) && L.getCloneLoss() >= L.getMaxHealth() * 1.5 || istype(L, /mob/living/simple_animal) && L.stat == DEAD)
|
if(istype(L, /mob/living/carbon) && L.getCloneLoss() >= L.getMaxHealth() * 1.5 || istype(L, /mob/living/simple_animal) && L.stat == DEAD)
|
||||||
to_chat(src, "This subject does not have an edible life energy...")
|
to_chat(src, "This subject does not have an edible life energy...")
|
||||||
return FALSE
|
return FALSE
|
||||||
if(L.buckled_mob)
|
if(L.has_buckled_mobs())
|
||||||
if(istype(L.buckled_mob, /mob/living/simple_animal/slime))
|
for(var/A in L.buckled_mobs)
|
||||||
if(L.buckled_mob != src)
|
if(istype(A, /mob/living/simple_animal/slime))
|
||||||
to_chat(src, "\The [L.buckled_mob] is already feeding on this subject...")
|
if(A != src)
|
||||||
return FALSE
|
to_chat(src, "\The [A] is already feeding on this subject...")
|
||||||
|
return FALSE
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/mob/living/simple_animal/slime/proc/start_consuming(var/mob/living/L)
|
/mob/living/simple_animal/slime/proc/start_consuming(var/mob/living/L)
|
||||||
|
|||||||
@@ -167,6 +167,12 @@
|
|||||||
src.m_flag = 1
|
src.m_flag = 1
|
||||||
if ((A != src.loc && A && A.z == src.z))
|
if ((A != src.loc && A && A.z == src.z))
|
||||||
src.last_move = get_dir(A, src.loc)
|
src.last_move = get_dir(A, src.loc)
|
||||||
|
if(.)
|
||||||
|
Moved(A, direct)
|
||||||
|
return
|
||||||
|
|
||||||
|
// Called on a successful Move().
|
||||||
|
/atom/movable/proc/Moved(atom/oldloc)
|
||||||
return
|
return
|
||||||
|
|
||||||
/client/proc/Move_object(direct)
|
/client/proc/Move_object(direct)
|
||||||
@@ -533,23 +539,23 @@
|
|||||||
|
|
||||||
/mob/proc/update_gravity()
|
/mob/proc/update_gravity()
|
||||||
return
|
return
|
||||||
|
/*
|
||||||
// The real Move() proc is above, but touching that massive block just to put this in isn't worth it.
|
// The real Move() proc is above, but touching that massive block just to put this in isn't worth it.
|
||||||
/mob/Move(var/newloc, var/direct)
|
/mob/Move(var/newloc, var/direct)
|
||||||
. = ..(newloc, direct)
|
. = ..(newloc, direct)
|
||||||
if(.)
|
if(.)
|
||||||
post_move(newloc, direct)
|
post_move(newloc, direct)
|
||||||
|
*/
|
||||||
// Called when a mob successfully moves.
|
// Called when a mob successfully moves.
|
||||||
// Would've been an /atom/movable proc but it caused issues.
|
// Would've been an /atom/movable proc but it caused issues.
|
||||||
/mob/proc/post_move(var/newloc, var/direct)
|
/mob/Moved(atom/oldloc)
|
||||||
for(var/obj/O in contents)
|
for(var/obj/O in contents)
|
||||||
O.on_loc_moved(newloc, direct)
|
O.on_loc_moved(oldloc)
|
||||||
|
|
||||||
// Received from post_move(), useful for items that need to know that their loc just moved.
|
// Received from Moved(), useful for items that need to know that their loc just moved.
|
||||||
/obj/proc/on_loc_moved(var/newloc, var/direct)
|
/obj/proc/on_loc_moved(atom/oldloc)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/storage/on_loc_moved(var/newloc, var/direct)
|
/obj/item/weapon/storage/on_loc_moved(atom/oldloc)
|
||||||
for(var/obj/O in contents)
|
for(var/obj/O in contents)
|
||||||
O.on_loc_moved(newloc, direct)
|
O.on_loc_moved(oldloc)
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
..(newloc, direct)
|
..(newloc, direct)
|
||||||
update_shield_positions()
|
update_shield_positions()
|
||||||
|
|
||||||
/obj/item/shield_projector/on_loc_moved(var/newloc, var/direct)
|
/obj/item/shield_projector/on_loc_moved(atom/oldloc)
|
||||||
update_shield_positions()
|
update_shield_positions()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -118,8 +118,9 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/vehicle/bike/bullet_act(var/obj/item/projectile/Proj)
|
/obj/vehicle/bike/bullet_act(var/obj/item/projectile/Proj)
|
||||||
if(buckled_mob && prob(protection_percent))
|
if(has_buckled_mobs() && prob(protection_percent))
|
||||||
buckled_mob.bullet_act(Proj)
|
var/mob/living/L = pick(buckled_mobs)
|
||||||
|
L.bullet_act(Proj)
|
||||||
return
|
return
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|||||||
82
code/modules/vehicles/boat.dm
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/obj/vehicle/boat
|
||||||
|
name = "boat"
|
||||||
|
desc = "It's a wooden boat. Looks like it'll hold two people. Oars not included."
|
||||||
|
icon = 'icons/obj/vehicles_36x32.dmi'
|
||||||
|
icon_state = "boat"
|
||||||
|
health = 100
|
||||||
|
maxhealth = 100
|
||||||
|
charge_use = 0 // Boats use oars.
|
||||||
|
pixel_x = -2
|
||||||
|
move_delay = 3 // Rather slow, but still faster than swimming, and won't get you wet.
|
||||||
|
max_buckled_mobs = 2
|
||||||
|
anchored = FALSE
|
||||||
|
var/material/material = null
|
||||||
|
var/riding_datum_type = /datum/riding/boat/small
|
||||||
|
|
||||||
|
/obj/vehicle/boat/sifwood/New(newloc, material_name)
|
||||||
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
|
/obj/vehicle/boat/dragon
|
||||||
|
name = "dragon boat"
|
||||||
|
desc = "It's a large wooden boat, carved to have a nordic-looking dragon on the front. Looks like it'll hold five people. Oars not included."
|
||||||
|
icon = 'icons/obj/64x32.dmi'
|
||||||
|
icon_state = "dragon_boat"
|
||||||
|
health = 250
|
||||||
|
maxhealth = 250
|
||||||
|
pixel_x = -16
|
||||||
|
max_buckled_mobs = 5
|
||||||
|
riding_datum_type = /datum/riding/boat/big
|
||||||
|
|
||||||
|
/obj/vehicle/boat/dragon/New(newloc, material_name)
|
||||||
|
..(newloc, material_name)
|
||||||
|
var/image/I = image(icon, src, "dragon_boat_underlay", BELOW_MOB_LAYER)
|
||||||
|
underlays += I
|
||||||
|
|
||||||
|
/obj/vehicle/boat/dragon/sifwood/New(newloc, material_name)
|
||||||
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
|
// Oars, which must be held inhand while in a boat to move it.
|
||||||
|
/obj/item/weapon/oar
|
||||||
|
name = "oar"
|
||||||
|
icon = 'icons/obj/vehicles.dmi'
|
||||||
|
desc = "Used to provide propulsion to a boat."
|
||||||
|
icon_state = "oar"
|
||||||
|
item_state = "oar"
|
||||||
|
force = 12
|
||||||
|
var/material/material = null
|
||||||
|
|
||||||
|
/obj/item/weapon/oar/sifwood/New(newloc, material_name)
|
||||||
|
..(newloc, MAT_SIFWOOD)
|
||||||
|
|
||||||
|
/obj/item/weapon/oar/New(newloc, material_name)
|
||||||
|
..(newloc)
|
||||||
|
if(!material_name)
|
||||||
|
material_name = "wood"
|
||||||
|
material = get_material_by_name("[material_name]")
|
||||||
|
if(!material)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
color = material.icon_colour
|
||||||
|
|
||||||
|
/obj/vehicle/boat/New(newloc, material_name)
|
||||||
|
..(newloc)
|
||||||
|
if(!material_name)
|
||||||
|
material_name = "wood"
|
||||||
|
material = get_material_by_name("[material_name]")
|
||||||
|
if(!material)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
color = material.icon_colour
|
||||||
|
riding_datum = new riding_datum_type(src)
|
||||||
|
|
||||||
|
// Boarding.
|
||||||
|
/obj/vehicle/boat/MouseDrop_T(var/atom/movable/C, mob/user)
|
||||||
|
if(ismob(C))
|
||||||
|
user_buckle_mob(C, user)
|
||||||
|
else
|
||||||
|
..(C, user)
|
||||||
|
|
||||||
|
/obj/vehicle/boat/load(mob/living/L, mob/living/user)
|
||||||
|
if(!istype(L)) // Only mobs on boats.
|
||||||
|
return FALSE
|
||||||
|
..(L, user)
|
||||||
@@ -81,8 +81,9 @@
|
|||||||
|
|
||||||
//cargo trains are open topped, so there is a chance the projectile will hit the mob ridding the train instead
|
//cargo trains are open topped, so there is a chance the projectile will hit the mob ridding the train instead
|
||||||
/obj/vehicle/train/cargo/bullet_act(var/obj/item/projectile/Proj)
|
/obj/vehicle/train/cargo/bullet_act(var/obj/item/projectile/Proj)
|
||||||
if(buckled_mob && prob(70))
|
if(has_buckled_mobs() && prob(70))
|
||||||
buckled_mob.bullet_act(Proj)
|
var/mob/living/L = pick(buckled_mobs)
|
||||||
|
L.bullet_act(Proj)
|
||||||
return
|
return
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -256,7 +257,7 @@
|
|||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
// Loading/unloading procs
|
// Loading/unloading procs
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
/obj/vehicle/train/cargo/trolley/load(var/atom/movable/C)
|
/obj/vehicle/train/cargo/trolley/load(var/atom/movable/C, var/mob/user)
|
||||||
if(ismob(C) && !passenger_allowed)
|
if(ismob(C) && !passenger_allowed)
|
||||||
return 0
|
return 0
|
||||||
if(!istype(C,/obj/machinery) && !istype(C,/obj/structure/closet) && !istype(C,/obj/structure/largecrate) && !istype(C,/obj/structure/reagent_dispensers) && !istype(C,/obj/structure/ore_box) && !istype(C, /mob/living/carbon/human))
|
if(!istype(C,/obj/machinery) && !istype(C,/obj/structure/closet) && !istype(C,/obj/structure/largecrate) && !istype(C,/obj/structure/reagent_dispensers) && !istype(C,/obj/structure/ore_box) && !istype(C, /mob/living/carbon/human))
|
||||||
@@ -267,12 +268,12 @@
|
|||||||
if(istype(C, /obj/machinery))
|
if(istype(C, /obj/machinery))
|
||||||
load_object(C)
|
load_object(C)
|
||||||
else
|
else
|
||||||
..()
|
..(C, user)
|
||||||
|
|
||||||
if(load)
|
if(load)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/obj/vehicle/train/cargo/engine/load(var/atom/movable/C)
|
/obj/vehicle/train/cargo/engine/load(var/atom/movable/C, var/mob/user)
|
||||||
if(!istype(C, /mob/living/carbon/human))
|
if(!istype(C, /mob/living/carbon/human))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
if(istype(C,/obj/vehicle/train))
|
if(istype(C,/obj/vehicle/train))
|
||||||
latch(C, user)
|
latch(C, user)
|
||||||
else
|
else
|
||||||
if(!load(C))
|
if(!load(C, user))
|
||||||
user << "<font color='red'>You were unable to load [C] on [src].</font>"
|
user << "<font color='red'>You were unable to load [C] on [src].</font>"
|
||||||
|
|
||||||
/obj/vehicle/train/attack_hand(mob/user as mob)
|
/obj/vehicle/train/attack_hand(mob/user as mob)
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
else if(load)
|
else if(load)
|
||||||
unload(user) //unload if loaded
|
unload(user) //unload if loaded
|
||||||
else if(!load && !user.buckled)
|
else if(!load && !user.buckled)
|
||||||
load(user) //else try climbing on board
|
load(user, user) //else try climbing on board
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
buckle_movable = 1
|
buckle_movable = 1
|
||||||
buckle_lying = 0
|
buckle_lying = 0
|
||||||
|
|
||||||
|
var/mechanical = TRUE // If false, doesn't care for things like cells, engines, EMP, keys, etc.
|
||||||
var/attack_log = null
|
var/attack_log = null
|
||||||
var/on = 0
|
var/on = 0
|
||||||
var/health = 0 //do not forget to set health for your vehicle!
|
var/health = 0 //do not forget to set health for your vehicle!
|
||||||
@@ -39,6 +40,8 @@
|
|||||||
var/load_offset_y = 0 //pixel_y offset for item overlay
|
var/load_offset_y = 0 //pixel_y offset for item overlay
|
||||||
var/mob_offset_y = 0 //pixel_y offset for mob overlay
|
var/mob_offset_y = 0 //pixel_y offset for mob overlay
|
||||||
|
|
||||||
|
var/datum/riding/riding_datum = null
|
||||||
|
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
// Standard procs
|
// Standard procs
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
@@ -46,10 +49,47 @@
|
|||||||
..()
|
..()
|
||||||
//spawn the cell you want in each vehicle
|
//spawn the cell you want in each vehicle
|
||||||
|
|
||||||
|
/obj/vehicle/Destroy()
|
||||||
|
qdel_null(riding_datum)
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
//BUCKLE HOOKS
|
||||||
|
|
||||||
|
/obj/vehicle/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE)
|
||||||
|
. = ..()
|
||||||
|
M.update_water()
|
||||||
|
if(riding_datum)
|
||||||
|
riding_datum.ridden = src
|
||||||
|
riding_datum.handle_vehicle_offsets()
|
||||||
|
|
||||||
|
/obj/vehicle/unbuckle_mob(mob/living/buckled_mob, force = FALSE)
|
||||||
|
. = ..(buckled_mob, force)
|
||||||
|
buckled_mob.update_water()
|
||||||
|
if(riding_datum)
|
||||||
|
riding_datum.restore_position(buckled_mob)
|
||||||
|
riding_datum.handle_vehicle_offsets() // So the person in back goes to the front.
|
||||||
|
|
||||||
|
/obj/vehicle/set_dir(newdir)
|
||||||
|
..(newdir)
|
||||||
|
if(riding_datum)
|
||||||
|
riding_datum.handle_vehicle_offsets()
|
||||||
|
|
||||||
|
//MOVEMENT
|
||||||
|
/obj/vehicle/relaymove(mob/user, direction)
|
||||||
|
if(riding_datum)
|
||||||
|
riding_datum.handle_ride(user, direction)
|
||||||
|
|
||||||
|
|
||||||
|
/obj/vehicle/Moved()
|
||||||
|
. = ..()
|
||||||
|
if(riding_datum)
|
||||||
|
riding_datum.handle_vehicle_layer()
|
||||||
|
riding_datum.handle_vehicle_offsets()
|
||||||
|
|
||||||
/obj/vehicle/Move()
|
/obj/vehicle/Move()
|
||||||
if(world.time > l_move_time + move_delay)
|
if(world.time > l_move_time + move_delay)
|
||||||
var/old_loc = get_turf(src)
|
var/old_loc = get_turf(src)
|
||||||
if(on && powered && cell.charge < charge_use)
|
if(mechanical && on && powered && cell.charge < charge_use)
|
||||||
turn_off()
|
turn_off()
|
||||||
|
|
||||||
var/init_anc = anchored
|
var/init_anc = anchored
|
||||||
@@ -61,7 +101,7 @@
|
|||||||
set_dir(get_dir(old_loc, loc))
|
set_dir(get_dir(old_loc, loc))
|
||||||
anchored = init_anc
|
anchored = init_anc
|
||||||
|
|
||||||
if(on && powered)
|
if(mechanical && on && powered)
|
||||||
cell.use(charge_use)
|
cell.use(charge_use)
|
||||||
|
|
||||||
//Dummy loads do not have to be moved as they are just an overlay
|
//Dummy loads do not have to be moved as they are just an overlay
|
||||||
@@ -77,32 +117,34 @@
|
|||||||
/obj/vehicle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/vehicle/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
if(istype(W, /obj/item/weapon/hand_labeler))
|
if(istype(W, /obj/item/weapon/hand_labeler))
|
||||||
return
|
return
|
||||||
if(istype(W, /obj/item/weapon/screwdriver))
|
if(mechanical)
|
||||||
if(!locked)
|
if(istype(W, /obj/item/weapon/screwdriver))
|
||||||
open = !open
|
if(!locked)
|
||||||
update_icon()
|
open = !open
|
||||||
user << "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>"
|
update_icon()
|
||||||
playsound(src, W.usesound, 50, 1)
|
user << "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>"
|
||||||
else if(istype(W, /obj/item/weapon/crowbar) && cell && open)
|
playsound(src, W.usesound, 50, 1)
|
||||||
remove_cell(user)
|
else if(istype(W, /obj/item/weapon/crowbar) && cell && open)
|
||||||
|
remove_cell(user)
|
||||||
|
|
||||||
else if(istype(W, /obj/item/weapon/cell) && !cell && open)
|
else if(istype(W, /obj/item/weapon/cell) && !cell && open)
|
||||||
insert_cell(W, user)
|
insert_cell(W, user)
|
||||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||||
var/obj/item/weapon/weldingtool/T = W
|
var/obj/item/weapon/weldingtool/T = W
|
||||||
if(T.welding)
|
if(T.welding)
|
||||||
if(health < maxhealth)
|
if(health < maxhealth)
|
||||||
if(open)
|
if(open)
|
||||||
health = min(maxhealth, health+10)
|
health = min(maxhealth, health+10)
|
||||||
user.setClickCooldown(user.get_attack_speed(W))
|
user.setClickCooldown(user.get_attack_speed(W))
|
||||||
playsound(src, T.usesound, 50, 1)
|
playsound(src, T.usesound, 50, 1)
|
||||||
user.visible_message("<font color='red'>[user] repairs [src]!</font>","<font color='blue'> You repair [src]!</font>")
|
user.visible_message("<font color='red'>[user] repairs [src]!</font>","<font color='blue'> You repair [src]!</font>")
|
||||||
|
else
|
||||||
|
user << "<span class='notice'>Unable to repair with the maintenance panel closed.</span>"
|
||||||
else
|
else
|
||||||
user << "<span class='notice'>Unable to repair with the maintenance panel closed.</span>"
|
user << "<span class='notice'>[src] does not need a repair.</span>"
|
||||||
else
|
else
|
||||||
user << "<span class='notice'>[src] does not need a repair.</span>"
|
user << "<span class='notice'>Unable to repair while [src] is off.</span>"
|
||||||
else
|
|
||||||
user << "<span class='notice'>Unable to repair while [src] is off.</span>"
|
|
||||||
else if(hasvar(W,"force") && hasvar(W,"damtype"))
|
else if(hasvar(W,"force") && hasvar(W,"damtype"))
|
||||||
user.setClickCooldown(user.get_attack_speed(W))
|
user.setClickCooldown(user.get_attack_speed(W))
|
||||||
switch(W.damtype)
|
switch(W.damtype)
|
||||||
@@ -139,6 +181,9 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/vehicle/emp_act(severity)
|
/obj/vehicle/emp_act(severity)
|
||||||
|
if(!mechanical)
|
||||||
|
return
|
||||||
|
|
||||||
var/was_on = on
|
var/was_on = on
|
||||||
stat |= EMPED
|
stat |= EMPED
|
||||||
var/obj/effect/overlay/pulse2 = new /obj/effect/overlay(src.loc)
|
var/obj/effect/overlay/pulse2 = new /obj/effect/overlay(src.loc)
|
||||||
@@ -168,41 +213,37 @@
|
|||||||
// Vehicle procs
|
// Vehicle procs
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
/obj/vehicle/proc/turn_on()
|
/obj/vehicle/proc/turn_on()
|
||||||
if(stat)
|
if(!mechanical || stat)
|
||||||
return 0
|
return FALSE
|
||||||
if(powered && cell.charge < charge_use)
|
if(powered && cell.charge < charge_use)
|
||||||
return 0
|
return FALSE
|
||||||
on = 1
|
on = 1
|
||||||
set_light(initial(light_range))
|
set_light(initial(light_range))
|
||||||
update_icon()
|
update_icon()
|
||||||
return 1
|
return TRUE
|
||||||
|
|
||||||
/obj/vehicle/proc/turn_off()
|
/obj/vehicle/proc/turn_off()
|
||||||
|
if(!mechanical)
|
||||||
|
return FALSE
|
||||||
on = 0
|
on = 0
|
||||||
set_light(0)
|
set_light(0)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/vehicle/emag_act(var/remaining_charges, mob/user as mob)
|
/obj/vehicle/emag_act(var/remaining_charges, mob/user as mob)
|
||||||
|
if(!mechanical)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
if(!emagged)
|
if(!emagged)
|
||||||
emagged = 1
|
emagged = 1
|
||||||
if(locked)
|
if(locked)
|
||||||
locked = 0
|
locked = 0
|
||||||
user << "<span class='warning'>You bypass [src]'s controls.</span>"
|
user << "<span class='warning'>You bypass [src]'s controls.</span>"
|
||||||
return 1
|
return TRUE
|
||||||
|
|
||||||
/obj/vehicle/proc/explode()
|
/obj/vehicle/proc/explode()
|
||||||
src.visible_message("<font color='red'><B>[src] blows apart!</B></font>", 1)
|
src.visible_message("<font color='red'><B>[src] blows apart!</B></font>", 1)
|
||||||
var/turf/Tsec = get_turf(src)
|
var/turf/Tsec = get_turf(src)
|
||||||
|
|
||||||
new /obj/item/stack/rods(Tsec)
|
|
||||||
new /obj/item/stack/rods(Tsec)
|
|
||||||
new /obj/item/stack/cable_coil/cut(Tsec)
|
|
||||||
|
|
||||||
if(cell)
|
|
||||||
cell.forceMove(Tsec)
|
|
||||||
cell.update_icon()
|
|
||||||
cell = null
|
|
||||||
|
|
||||||
//stuns people who are thrown off a train that has been blown up
|
//stuns people who are thrown off a train that has been blown up
|
||||||
if(istype(load, /mob/living))
|
if(istype(load, /mob/living))
|
||||||
var/mob/living/M = load
|
var/mob/living/M = load
|
||||||
@@ -210,8 +251,17 @@
|
|||||||
|
|
||||||
unload()
|
unload()
|
||||||
|
|
||||||
new /obj/effect/gibspawner/robot(Tsec)
|
if(mechanical)
|
||||||
new /obj/effect/decal/cleanable/blood/oil(src.loc)
|
new /obj/item/stack/rods(Tsec)
|
||||||
|
new /obj/item/stack/rods(Tsec)
|
||||||
|
new /obj/item/stack/cable_coil/cut(Tsec)
|
||||||
|
new /obj/effect/gibspawner/robot(Tsec)
|
||||||
|
new /obj/effect/decal/cleanable/blood/oil(src.loc)
|
||||||
|
|
||||||
|
if(cell)
|
||||||
|
cell.forceMove(Tsec)
|
||||||
|
cell.update_icon()
|
||||||
|
cell = null
|
||||||
|
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
@@ -220,6 +270,9 @@
|
|||||||
explode()
|
explode()
|
||||||
|
|
||||||
/obj/vehicle/proc/powercheck()
|
/obj/vehicle/proc/powercheck()
|
||||||
|
if(!mechanical)
|
||||||
|
return
|
||||||
|
|
||||||
if(!cell && !powered)
|
if(!cell && !powered)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -236,6 +289,8 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/vehicle/proc/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
|
/obj/vehicle/proc/insert_cell(var/obj/item/weapon/cell/C, var/mob/living/carbon/human/H)
|
||||||
|
if(!mechanical)
|
||||||
|
return
|
||||||
if(cell)
|
if(cell)
|
||||||
return
|
return
|
||||||
if(!istype(C))
|
if(!istype(C))
|
||||||
@@ -248,6 +303,8 @@
|
|||||||
usr << "<span class='notice'>You install [C] in [src].</span>"
|
usr << "<span class='notice'>You install [C] in [src].</span>"
|
||||||
|
|
||||||
/obj/vehicle/proc/remove_cell(var/mob/living/carbon/human/H)
|
/obj/vehicle/proc/remove_cell(var/mob/living/carbon/human/H)
|
||||||
|
if(mechanical)
|
||||||
|
return
|
||||||
if(!cell)
|
if(!cell)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -267,7 +324,7 @@
|
|||||||
// the vehicle load() definition before
|
// the vehicle load() definition before
|
||||||
// calling this parent proc.
|
// calling this parent proc.
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
/obj/vehicle/proc/load(var/atom/movable/C)
|
/obj/vehicle/proc/load(var/atom/movable/C, var/mob/living/user)
|
||||||
//This loads objects onto the vehicle so they can still be interacted with.
|
//This loads objects onto the vehicle so they can still be interacted with.
|
||||||
//Define allowed items for loading in specific vehicle definitions.
|
//Define allowed items for loading in specific vehicle definitions.
|
||||||
if(!isturf(C.loc)) //To prevent loading things from someone's inventory, which wouldn't get handled properly.
|
if(!isturf(C.loc)) //To prevent loading things from someone's inventory, which wouldn't get handled properly.
|
||||||
@@ -292,10 +349,10 @@
|
|||||||
C.pixel_y += mob_offset_y
|
C.pixel_y += mob_offset_y
|
||||||
else
|
else
|
||||||
C.pixel_y += load_offset_y
|
C.pixel_y += load_offset_y
|
||||||
C.layer = layer + 0.1 //so it sits above the vehicle
|
C.layer = layer + 0.1
|
||||||
|
|
||||||
if(ismob(C))
|
if(ismob(C))
|
||||||
buckle_mob(C)
|
user_buckle_mob(C, user)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@@ -358,7 +415,7 @@
|
|||||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name]</font>")
|
user.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name]</font>")
|
||||||
user.do_attack_animation(src)
|
user.do_attack_animation(src)
|
||||||
src.health -= damage
|
src.health -= damage
|
||||||
if(prob(10))
|
if(mechanical && prob(10))
|
||||||
new /obj/effect/decal/cleanable/blood/oil(src.loc)
|
new /obj/effect/decal/cleanable/blood/oil(src.loc)
|
||||||
spawn(1) healthcheck()
|
spawn(1) healthcheck()
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
36
html/changelogs/Neerti - Boats.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
################################
|
||||||
|
# Example Changelog File
|
||||||
|
#
|
||||||
|
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||||
|
#
|
||||||
|
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||||
|
# When it is, any changes listed below will disappear.
|
||||||
|
#
|
||||||
|
# Valid Prefixes:
|
||||||
|
# bugfix
|
||||||
|
# wip (For works in progress)
|
||||||
|
# tweak
|
||||||
|
# soundadd
|
||||||
|
# sounddel
|
||||||
|
# rscadd (general adding of nice things)
|
||||||
|
# rscdel (general deleting of nice things)
|
||||||
|
# imageadd
|
||||||
|
# imagedel
|
||||||
|
# maptweak
|
||||||
|
# spellcheck (typo fixes)
|
||||||
|
# experiment
|
||||||
|
#################################
|
||||||
|
|
||||||
|
# Your name.
|
||||||
|
author: Neerti
|
||||||
|
|
||||||
|
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
# Any changes you've made. See valid prefix list above.
|
||||||
|
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||||
|
# SCREW THIS UP AND IT WON'T WORK.
|
||||||
|
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||||
|
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||||
|
changes:
|
||||||
|
- rscadd: "Adds boats that can be ridden by multiple people, which use oars. Can be crafted with large amounts of wooden planks."
|
||||||
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
BIN
icons/obj/64x32.dmi
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
BIN
icons/obj/vehicles_36x32.dmi
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
@@ -193,6 +193,7 @@
|
|||||||
#include "code\datums\organs.dm"
|
#include "code\datums\organs.dm"
|
||||||
#include "code\datums\progressbar.dm"
|
#include "code\datums\progressbar.dm"
|
||||||
#include "code\datums\recipe.dm"
|
#include "code\datums\recipe.dm"
|
||||||
|
#include "code\datums\riding.dm"
|
||||||
#include "code\datums\sun.dm"
|
#include "code\datums\sun.dm"
|
||||||
#include "code\datums\weakref.dm"
|
#include "code\datums\weakref.dm"
|
||||||
#include "code\datums\autolathe\arms.dm"
|
#include "code\datums\autolathe\arms.dm"
|
||||||
@@ -2272,6 +2273,7 @@
|
|||||||
#include "code\modules\turbolift\turbolift_map.dm"
|
#include "code\modules\turbolift\turbolift_map.dm"
|
||||||
#include "code\modules\turbolift\turbolift_process.dm"
|
#include "code\modules\turbolift\turbolift_process.dm"
|
||||||
#include "code\modules\turbolift\turbolift_turfs.dm"
|
#include "code\modules\turbolift\turbolift_turfs.dm"
|
||||||
|
#include "code\modules\vehicles\boat.dm"
|
||||||
#include "code\modules\vehicles\cargo_train.dm"
|
#include "code\modules\vehicles\cargo_train.dm"
|
||||||
#include "code\modules\vehicles\train.dm"
|
#include "code\modules\vehicles\train.dm"
|
||||||
#include "code\modules\vehicles\vehicle.dm"
|
#include "code\modules\vehicles\vehicle.dm"
|
||||||
|
|||||||