tether module
This commit is contained in:
@@ -158,6 +158,7 @@
|
||||
/obj/item/mod/module/welding,
|
||||
/obj/item/mod/module/rad_protection,
|
||||
/obj/item/mod/module/flashlight,
|
||||
/obj/item/mod/module/tether,
|
||||
)
|
||||
|
||||
/obj/item/mod/control/pre_equipped/responsory
|
||||
@@ -248,6 +249,7 @@
|
||||
/obj/item/mod/module/flashlight,
|
||||
/obj/item/mod/module/bikehorn,
|
||||
/obj/item/mod/module/rad_protection,
|
||||
/obj/item/mod/module/tether,
|
||||
) //one of every type of module, for testing if they all work correctly
|
||||
|
||||
/obj/item/mod/control/pre_equipped/administrative
|
||||
|
||||
@@ -81,7 +81,64 @@
|
||||
complexity = 0
|
||||
slowdown_active = 0
|
||||
|
||||
// No tether module, sorry!
|
||||
///Emergency Tether - Shoots a grappling hook projectile in 0g that throws the user towards it.
|
||||
/obj/item/mod/module/tether
|
||||
name = "MOD emergency tether module"
|
||||
desc = "A custom-built grappling-hook powered by a winch capable of hauling the user. \
|
||||
While some older models of cargo-oriented grapples have capacities of a few tons, \
|
||||
these are only capable of working in zero-gravity environments, a blessing to some Engineers."
|
||||
icon_state = "tether"
|
||||
module_type = MODULE_ACTIVE
|
||||
complexity = 3
|
||||
use_power_cost = DEFAULT_CHARGE_DRAIN
|
||||
incompatible_modules = list(/obj/item/mod/module/tether)
|
||||
cooldown_time = 1.5 SECONDS
|
||||
|
||||
/obj/item/mod/module/tether/on_use()
|
||||
if(mod.wearer.has_gravity(get_turf(src)))
|
||||
balloon_alert(mod.wearer, "too much gravity!")
|
||||
playsound(src, "gun_dry_fire", 25, TRUE)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/item/mod/module/tether/on_select_use(atom/target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
var/obj/item/projectile/tether = new /obj/item/projectile/tether(mod.wearer.loc)
|
||||
tether.preparePixelProjectile(target, mod.wearer)
|
||||
tether.firer = mod.wearer
|
||||
playsound(src, 'sound/weapons/batonextend.ogg', 25, TRUE)
|
||||
INVOKE_ASYNC(tether, /obj/item/projectile.proc/fire)
|
||||
drain_power(use_power_cost)
|
||||
|
||||
/obj/item/projectile/tether
|
||||
name = "tether"
|
||||
icon_state = "tether_projectile"
|
||||
icon = 'icons/obj/clothing/modsuit/mod_modules.dmi'
|
||||
damage = 0
|
||||
nodamage = TRUE
|
||||
range = 10
|
||||
hitsound = 'sound/weapons/batonextend.ogg'
|
||||
hitsound_wall = 'sound/weapons/batonextend.ogg'
|
||||
suppressed = SUPPRESSED_VERY
|
||||
hit_threshhold = LATTICE_LAYER
|
||||
/// Reference to the beam following the projectile.
|
||||
var/line
|
||||
|
||||
/obj/item/projectile/tether/fire(setAngle)
|
||||
if(firer)
|
||||
line = firer.Beam(src, "line", 'icons/obj/clothing/modsuit/mod_modules.dmi')
|
||||
..()
|
||||
|
||||
/obj/item/projectile/tether/on_hit(atom/target)
|
||||
. = ..()
|
||||
if(firer)
|
||||
firer.throw_at(target, 10, 1, firer, FALSE, FALSE, null, MOVE_FORCE_NORMAL, TRUE)
|
||||
|
||||
/obj/item/projectile/tether/Destroy()
|
||||
QDEL_NULL(line)
|
||||
return ..()
|
||||
|
||||
///Radiation Protection - Protects the user from radiation, gives them a geiger counter and rad info in the panel.
|
||||
/obj/item/mod/module/rad_protection
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
var/projectile_piercing = NONE
|
||||
/// number of times we've pierced something. Incremented BEFORE bullet_act and on_hit proc!
|
||||
var/pierces = 0
|
||||
/// If objects are below this layer, we pass through them
|
||||
var/hit_threshhold = PROJECTILE_HIT_THRESHHOLD_LAYER
|
||||
/// "leftover" pixels for Range() calculation as pixel_move() was moved to simulated semi-pixel movement and Range() is in tiles.
|
||||
var/pixels_range_leftover = 0
|
||||
/// "leftover" tick pixels and stuff yeah, so we don't round off things and introducing tracing inaccuracy.
|
||||
@@ -519,7 +521,7 @@
|
||||
if(!isliving(target))
|
||||
if(isturf(target)) // non dense turfs
|
||||
return FALSE
|
||||
if(target.layer < PROJECTILE_HIT_THRESHHOLD_LAYER)
|
||||
if(target.layer < hit_threshhold)
|
||||
return FALSE
|
||||
else if(!direct_target) // non dense objects do not get hit unless specifically clicked
|
||||
return FALSE
|
||||
|
||||
@@ -241,6 +241,14 @@
|
||||
build_type = PROTOLATHE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SECURITY
|
||||
|
||||
/datum/design/module/mod_tether
|
||||
name = "Emergency Tether Module"
|
||||
id = "mod_tether"
|
||||
materials = list(/datum/material/iron = 1000, /datum/material/silver = 500)
|
||||
build_path = /obj/item/mod/module/tether
|
||||
build_type = PROTOLATHE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/module/mod_mouthhole
|
||||
name = "Eating Apparatus Module"
|
||||
id = "mod_mouthhole"
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
"mod_visor_meson",
|
||||
"mod_t_ray",
|
||||
"mod_magboot",
|
||||
"mod_tether",
|
||||
"mod_constructor",
|
||||
"mod_mister_atmos",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user