modsuits part 1
This commit is contained in:
committed by
Jerry Wester
parent
792790216d
commit
183b554ed3
@@ -0,0 +1,48 @@
|
||||
/// An AI controller for the MODsuit pathfinder module. It's activated by implant and attaches itself to the user.
|
||||
/datum/ai_controller/mod
|
||||
blackboard = list(
|
||||
BB_MOD_TARGET,
|
||||
BB_MOD_IMPLANT,
|
||||
)
|
||||
max_target_distance = MOD_AI_RANGE //a little spicy but its one specific item that summons it, and it doesnt run otherwise
|
||||
ai_movement = /datum/ai_movement/jps
|
||||
///ID card generated from the suit's required access. Used for pathing.
|
||||
var/obj/item/card/id/advanced/id_card
|
||||
|
||||
/datum/ai_controller/mod/TryPossessPawn(atom/new_pawn)
|
||||
if(!istype(new_pawn, /obj/item/mod/control))
|
||||
return AI_CONTROLLER_INCOMPATIBLE
|
||||
var/obj/item/mod/control/mod = new_pawn
|
||||
id_card = new /obj/item/card/id/advanced/simple_bot()
|
||||
if(length(mod.req_access))
|
||||
id_card.set_access(mod.req_access)
|
||||
return ..() //Run parent at end
|
||||
|
||||
/datum/ai_controller/mod/UnpossessPawn(destroy)
|
||||
QDEL_NULL(id_card)
|
||||
return ..() //Run parent at end
|
||||
|
||||
/datum/ai_controller/mod/SelectBehaviors(delta_time)
|
||||
current_behaviors = list()
|
||||
if(blackboard[BB_MOD_TARGET] && blackboard[BB_MOD_IMPLANT])
|
||||
queue_behavior(/datum/ai_behavior/mod_attach)
|
||||
|
||||
/datum/ai_controller/mod/get_access()
|
||||
return id_card
|
||||
|
||||
/datum/ai_behavior/mod_attach
|
||||
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT|AI_BEHAVIOR_MOVE_AND_PERFORM
|
||||
|
||||
/datum/ai_behavior/mod_attach/perform(delta_time, datum/ai_controller/controller)
|
||||
. = ..()
|
||||
if(!controller.pawn.Adjacent(controller.blackboard[BB_MOD_TARGET]))
|
||||
return
|
||||
var/obj/item/implant/mod/implant = controller.blackboard[BB_MOD_IMPLANT]
|
||||
implant.module.attach(controller.blackboard[BB_MOD_TARGET])
|
||||
finish_action(controller, TRUE)
|
||||
|
||||
/datum/ai_behavior/mod_attach/finish_action(datum/ai_controller/controller, succeeded)
|
||||
. = ..()
|
||||
controller.blackboard[BB_MOD_TARGET] = null
|
||||
var/obj/item/implant/mod/implant = controller.blackboard[BB_MOD_IMPLANT]
|
||||
implant.end_recall(succeeded)
|
||||
@@ -554,6 +554,19 @@
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISCELLANEOUS
|
||||
|
||||
/datum/crafting_recipe/mod_core
|
||||
name = "MOD core"
|
||||
result = /obj/item/mod/construction/core
|
||||
tool_behaviors = list(TOOL_SCREWDRIVER)
|
||||
time = 10 SECONDS
|
||||
reqs = list(/obj/item/stack/cable_coil = 5,
|
||||
/obj/item/stack/rods = 2,
|
||||
/obj/item/stack/sheet/glass = 1,
|
||||
/obj/item/organ/heart = 1
|
||||
)
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISCELLANEOUS
|
||||
|
||||
//////////////
|
||||
//Banners/////
|
||||
//////////////
|
||||
|
||||
@@ -369,9 +369,10 @@
|
||||
//Tries to dump content
|
||||
/datum/component/storage/proc/dump_content_at(atom/dest_object, mob/M)
|
||||
var/atom/A = parent
|
||||
var/atom/dump_destination = dest_object.get_dumping_location()
|
||||
if(A.Adjacent(M) && dump_destination && M.Adjacent(dump_destination))
|
||||
var/atom/dump_destination = get_dumping_location(dest_object)
|
||||
if(M.CanReach(A) && dump_destination && M.CanReach(dump_destination))
|
||||
if(check_locked(null, M, TRUE))
|
||||
to_chat(M, "<span class='warning'>[parent] seems to be locked!</span>")
|
||||
return FALSE
|
||||
if(dump_destination.storage_contents_dump_act(src, M))
|
||||
playsound(A, "rustle", 50, 1, -5)
|
||||
|
||||
@@ -348,12 +348,21 @@
|
||||
/datum/preset_holoimage/engineer/rig
|
||||
outfit_type = /datum/outfit/job/engineer/gloved/rig
|
||||
|
||||
/datum/preset_holoimage/engineer/mod
|
||||
outfit_type = /datum/outfit/job/engineer/mod
|
||||
|
||||
/datum/preset_holoimage/engineer/ce
|
||||
outfit_type = /datum/outfit/job/ce
|
||||
|
||||
/datum/preset_holoimage/engineer/ce/mod
|
||||
outfit_type = /datum/outfit/job/ce/mod
|
||||
|
||||
/datum/preset_holoimage/engineer/ce/rig
|
||||
outfit_type = /datum/outfit/job/engineer/gloved/rig
|
||||
|
||||
/datum/preset_holoimage/engineer/atmos/mod
|
||||
outfit_type = /datum/outfit/job/atmos/mod
|
||||
|
||||
/datum/preset_holoimage/engineer/atmos
|
||||
outfit_type = /datum/outfit/job/atmos
|
||||
|
||||
@@ -449,6 +458,7 @@
|
||||
SAY Oh, shit!
|
||||
DELAY 10
|
||||
PRESET /datum/preset_holoimage/engineer/atmos/rig
|
||||
PRESET /datum/preset_holoimage/engineer/atmos/mod
|
||||
LANGUAGE /datum/language/narsie
|
||||
NAME Unknown
|
||||
SAY RISE, MY LORD!!
|
||||
@@ -456,6 +466,7 @@
|
||||
LANGUAGE /datum/language/common
|
||||
NAME Plastic
|
||||
PRESET /datum/preset_holoimage/engineer/rig
|
||||
PRESET /datum/preset_holoimage/engineer/mod
|
||||
SAY Fuck, fuck, fuck!
|
||||
DELAY 20
|
||||
SAY It's loose! CALL THE FUCKING SHUTT-
|
||||
|
||||
+34
-21
@@ -79,6 +79,10 @@
|
||||
//Type path of item to go in left hand
|
||||
var/r_hand = null
|
||||
|
||||
|
||||
///ID of the slot containing a gas tank
|
||||
var/internals_slot = null
|
||||
|
||||
/// Any clothing accessory item
|
||||
var/accessory = null
|
||||
|
||||
@@ -140,6 +144,15 @@
|
||||
//to be overridden for toggling internals, id binding, access etc
|
||||
return
|
||||
|
||||
#define EQUIP_OUTFIT_ITEM(item_path, slot_name) if(##item_path) { \
|
||||
H.equip_to_slot_or_del(SSwardrobe.provide_type(##item_path), ##slot_name, TRUE); \
|
||||
var/obj/item/outfit_item = H.get_item_by_slot(##slot_name); \
|
||||
if (outfit_item && outfit_item.type == ##item_path) { \
|
||||
outfit_item.on_outfit_equip(H, visualsOnly, ##slot_name); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Equips all defined types and paths to the mob passed in
|
||||
*
|
||||
@@ -153,31 +166,32 @@
|
||||
|
||||
//Start with uniform,suit,backpack for additional slots
|
||||
if(uniform)
|
||||
H.equip_to_slot_or_del(new uniform(H), ITEM_SLOT_ICLOTHING, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(uniform, ITEM_SLOT_ICLOTHING)
|
||||
if(suit)
|
||||
H.equip_to_slot_or_del(new suit(H), ITEM_SLOT_OCLOTHING, TRUE)
|
||||
if(back)
|
||||
H.equip_to_slot_or_del(new back(H), ITEM_SLOT_BACK, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(suit, ITEM_SLOT_OCLOTHING)
|
||||
if(belt)
|
||||
H.equip_to_slot_or_del(new belt(H), ITEM_SLOT_BELT, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(belt, ITEM_SLOT_BELT)
|
||||
if(gloves)
|
||||
H.equip_to_slot_or_del(new gloves(H), ITEM_SLOT_GLOVES, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(gloves, ITEM_SLOT_GLOVES)
|
||||
if(shoes)
|
||||
H.equip_to_slot_or_del(new shoes(H), ITEM_SLOT_FEET, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(shoes, ITEM_SLOT_FEET)
|
||||
if(head)
|
||||
H.equip_to_slot_or_del(new head(H), ITEM_SLOT_HEAD, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(head, ITEM_SLOT_HEAD)
|
||||
if(mask)
|
||||
H.equip_to_slot_or_del(new mask(H), ITEM_SLOT_MASK, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(mask, ITEM_SLOT_MASK)
|
||||
if(neck)
|
||||
H.equip_to_slot_or_del(new neck(H), ITEM_SLOT_NECK, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(neck, ITEM_SLOT_NECK)
|
||||
if(ears)
|
||||
H.equip_to_slot_or_del(new ears(H), ITEM_SLOT_EARS, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(ears, ITEM_SLOT_EARS)
|
||||
if(glasses)
|
||||
H.equip_to_slot_or_del(new glasses(H), ITEM_SLOT_EYES, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(glasses, ITEM_SLOT_EYES)
|
||||
if(back)
|
||||
EQUIP_OUTFIT_ITEM(back, ITEM_SLOT_BACK)
|
||||
if(id)
|
||||
H.equip_to_slot_or_del(new id(H), ITEM_SLOT_ID, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(id, ITEM_SLOT_ID)
|
||||
if(suit_store)
|
||||
H.equip_to_slot_or_del(new suit_store(H), ITEM_SLOT_SUITSTORE, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(suit_store, ITEM_SLOT_SUITSTORE)
|
||||
|
||||
if(undershirt)
|
||||
H.undershirt = initial(undershirt.name)
|
||||
|
||||
@@ -195,9 +209,9 @@
|
||||
|
||||
if(!visualsOnly) // Items in pockets or backpack don't show up on mob's icon.
|
||||
if(l_pocket)
|
||||
H.equip_to_slot_or_del(new l_pocket(H), ITEM_SLOT_LPOCKET, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(l_pocket, ITEM_SLOT_LPOCKET)
|
||||
if(r_pocket)
|
||||
H.equip_to_slot_or_del(new r_pocket(H), ITEM_SLOT_RPOCKET, TRUE)
|
||||
EQUIP_OUTFIT_ITEM(r_pocket, ITEM_SLOT_RPOCKET)
|
||||
|
||||
if(box)
|
||||
if(!backpack_contents)
|
||||
@@ -211,11 +225,7 @@
|
||||
if(!isnum(number))//Default to 1
|
||||
number = 1
|
||||
for(var/i in 1 to number)
|
||||
H.equip_to_slot_or_del(new path(H), ITEM_SLOT_BACKPACK, TRUE)
|
||||
|
||||
if(!H.head && toggle_helmet && istype(H.wear_suit, /obj/item/clothing/suit/space/hardsuit))
|
||||
var/obj/item/clothing/suit/space/hardsuit/HS = H.wear_suit
|
||||
HS.ToggleHelmet()
|
||||
EQUIP_OUTFIT_ITEM(path, ITEM_SLOT_BACKPACK)
|
||||
|
||||
post_equip(H, visualsOnly, preference_source)
|
||||
|
||||
@@ -232,6 +242,9 @@
|
||||
H.update_body()
|
||||
return TRUE
|
||||
|
||||
#undef EQUIP_OUTFIT_ITEM
|
||||
|
||||
|
||||
/**
|
||||
* Apply a fingerprint from the passed in human to all items in the outfit
|
||||
*
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/datum/wires/mod
|
||||
holder_type = /obj/item/mod/control
|
||||
proper_name = "MOD control unit"
|
||||
|
||||
/datum/wires/mod/New(atom/holder)
|
||||
wires = list(WIRE_HACK, WIRE_DISABLE, WIRE_SHOCK, WIRE_INTERFACE)
|
||||
add_duds(2)
|
||||
..()
|
||||
|
||||
/datum/wires/mod/interactable(mob/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/mod/control/mod = holder
|
||||
return mod.open
|
||||
|
||||
/datum/wires/mod/get_status()
|
||||
var/obj/item/mod/control/mod = holder
|
||||
var/list/status = list()
|
||||
status += "The orange light is [mod.seconds_electrified ? "on" : "off"]."
|
||||
status += "The red light is [mod.malfunctioning ? "off" : "blinking"]."
|
||||
status += "The green light is [mod.locked ? "on" : "off"]."
|
||||
status += "The yellow light is [mod.interface_break ? "off" : "on"]."
|
||||
return status
|
||||
|
||||
/datum/wires/mod/on_pulse(wire)
|
||||
var/obj/item/mod/control/mod = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
mod.locked = !mod.locked
|
||||
if(WIRE_DISABLE)
|
||||
mod.malfunctioning = TRUE
|
||||
if(WIRE_SHOCK)
|
||||
mod.seconds_electrified = MACHINE_DEFAULT_ELECTRIFY_TIME
|
||||
if(WIRE_INTERFACE)
|
||||
mod.interface_break = !mod.interface_break
|
||||
|
||||
/datum/wires/mod/on_cut(wire, mend)
|
||||
var/obj/item/mod/control/mod = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
if(!mend)
|
||||
mod.req_access = list()
|
||||
if(WIRE_DISABLE)
|
||||
mod.malfunctioning = !mend
|
||||
if(WIRE_SHOCK)
|
||||
if(mend)
|
||||
mod.seconds_electrified = MACHINE_NOT_ELECTRIFIED
|
||||
else
|
||||
mod.seconds_electrified = MACHINE_ELECTRIFIED_PERMANENT
|
||||
if(WIRE_INTERFACE)
|
||||
mod.interface_break = !mend
|
||||
|
||||
/datum/wires/mod/ui_act(action, params)
|
||||
var/obj/item/mod/control/mod = holder
|
||||
if(!issilicon(usr) && mod.seconds_electrified && mod.shock(usr))
|
||||
return FALSE
|
||||
return ..()
|
||||
Reference in New Issue
Block a user