mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-21 21:23:11 +01:00
7b018e3281
* Upkeep on Mech code. Assembly Mines fixed, they do not spawn with an explosive payload from parent. Vehicles no longer ignore cliffs. Exosuits no longer ignore cliffs. Objects can fall off cliffs. Objects with a buckled person will hurt the person. (Rollerbeds looking at you.) Jumpjets added to allow planetary traversal, primarily useful upon the Serenity, Hoverpods, and Marauders (adminspawn). When toggled, they allow movement vertically, and prevent falling through open spaces. When used as the active equipment, it will launch the exosuit toward the target turf. When not on one of the above mentioned suits, it will cause a small explosion on launch, damaging the exosuit and anything directly nearby. * Fighters are flying. * Revert step delay floor adjustment. Flat strafing modifier of 1/5th of a second should be enough. * Correction and Tweak. * Fix stupidity.
66 lines
2.0 KiB
Plaintext
66 lines
2.0 KiB
Plaintext
/obj/item/mine/assembly
|
|
name = "mine assembly"
|
|
desc = "A small pressure-triggered device. Accepts grenades and tank transfer valves."
|
|
|
|
payload = null
|
|
|
|
var/static/list/accepts_items = list(
|
|
/obj/item/transfer_valve = /datum/mine_payload/assembly/tank_transfer_valve,
|
|
/obj/item/grenade = /datum/mine_payload/assembly/grenade
|
|
)
|
|
|
|
/obj/item/mine/assembly/attackby(obj/item/W, mob/living/user)
|
|
if(!armed && !triggering)
|
|
var/datum/mine_payload/assembly/attached_payload = payload
|
|
if(attached_payload?.attached)
|
|
if(W.is_screwdriver())
|
|
to_chat(user, "You disconnect \the [src]'s [attached_payload.attached.name] and remove it.")
|
|
attached_payload.attached.forceMove(get_turf(user))
|
|
payload.remove_from_mine()
|
|
QDEL_NULL(payload)
|
|
else
|
|
for(var/loadtype in accepts_items)
|
|
if(istype(W, loadtype))
|
|
user.drop_from_inventory(W)
|
|
W.forceMove(src)
|
|
var/payload_type = accepts_items[loadtype]
|
|
attached_payload = new payload_type
|
|
attached_payload.attached = W
|
|
payload = attached_payload
|
|
return TRUE
|
|
return ..()
|
|
|
|
/datum/mine_payload/assembly
|
|
var/obj/item/attached
|
|
|
|
/datum/mine_payload/assembly/New(var/obj/item/_attaching)
|
|
..()
|
|
attached = _attaching
|
|
|
|
/datum/mine_payload/assembly/Destroy()
|
|
QDEL_NULL(attached)
|
|
. = ..()
|
|
|
|
/datum/mine_payload/assembly/remove_from_mine()
|
|
attached = null
|
|
|
|
/datum/mine_payload/assembly/tank_transfer_valve/trigger_payload(var/obj/item/mine/owner, var/atom/trigger)
|
|
..()
|
|
if(istype(attached, /obj/item/transfer_valve))
|
|
var/obj/item/transfer_valve/ttv = attached
|
|
ttv.forceMove(get_turf(owner))
|
|
ttv.toggle_valve()
|
|
remove_from_mine()
|
|
|
|
/datum/mine_payload/assembly/grenade/trigger_payload(var/obj/item/mine/owner, var/atom/trigger)
|
|
..()
|
|
if(istype(attached, /obj/item/grenade))
|
|
var/obj/item/grenade/grenade = attached
|
|
grenade.forceMove(get_turf(owner))
|
|
if(ismob(trigger))
|
|
var/mob/victim = trigger
|
|
if(victim.ckey)
|
|
msg_admin_attack("[key_name_admin(victim)] stepped on \a [owner], triggering [grenade]")
|
|
grenade.activate()
|
|
remove_from_mine()
|