Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds armblade implant and support for item implants #6010

Merged
merged 4 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ See commit 36b8db4952be79a79b28a6738889d9e9eb23b12a

Sprites added in commit d407e97e26ee5e6bb1daf945a8eb3bd9a6b11976 are CC-BY-NC 3.0

All sounds added/remixed in the PR's:
All sounds added/remixed in the PRs:
https://github.com/tgstation/TerraGov-Marine-Corps/pull/5261
https://github.com/tgstation/TerraGov-Marine-Corps/pull/5861
are licensed under CC-BY-NC-SA 3.0

All icons in the PR:
https://github.com/tgstation/TerraGov-Marine-Corps/pull/6010
are licensed under CC-BY-NC-SA 3.0

Sound added in PR https://github.com/tgstation/TerraGov-Marine-Corps/pull/5604 is taken from https://freesound.org/people/nicStage/sounds/127731/ (CC Attribution)

Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var/malfunction = MALFUNCTION_NONE
///Implant secific flags
var/flags_implant = GRANT_ACTIVATION_ACTION
///Whitelist for llimbs that this implavnt is allowed to be inserted into, all limbs by default
var/list/allowed_limbs
///Activation_action reference
var/datum/action/item_action/implant/activation_action
///Cooldown between usages of the implant
Expand All @@ -30,6 +32,8 @@
if(allow_reagents)
reagents = new /datum/reagents(MAX_IMPLANT_REAGENTS)
reagents.my_atom = src
if(!allowed_limbs)
allowed_limbs = GLOB.human_body_parts


/obj/item/implant/Destroy(force)
Expand All @@ -54,6 +58,9 @@
SHOULD_CALL_PARENT(TRUE)
if(!ishuman(target))
return FALSE
if(!(user.zone_selected in allowed_limbs))
to_chat(user, "<span class='warning'>You cannot implant this into that limb!</span>")
return FALSE
return implant(target, user)

/**
Expand Down
76 changes: 76 additions & 0 deletions code/game/objects/items/implants/implant_items.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
///Deployitem implant, holds a item that can then be placed inhand to do whatever with
/obj/item/implant/deployitem
name = "item implants"
desc = "you shouldnt be seeing this"
allowed_limbs = list(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)
///Held item we want to be put in hand when the implant is activated
var/obj/item/helditem = /obj/item/healthanalyzer

/obj/item/implant/deployitem/Initialize(mapload)
. = ..()
helditem = new helditem(src)

/obj/item/implant/deployitem/activate()
. = ..()
if(!.)
return
if(malfunction == MALFUNCTION_PERMANENT)
return FALSE
if(helditem.loc != src)
fetch_item()
return
put_in_slots()
RegisterSignal(helditem, COMSIG_ITEM_DROPPED, .proc/fetch_item)

///Takes the held item and puts it into it's predestined slot
/obj/item/implant/deployitem/proc/put_in_slots()
switch(part.name)
if(BODY_ZONE_R_ARM)
implant_owner.put_in_r_hand(helditem)
if(BODY_ZONE_L_ARM)
implant_owner.put_in_l_hand(helditem)
Comment on lines +25 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be able to put in other slots as well


///grabs the held item when it changes equip or is dropped
/obj/item/implant/deployitem/proc/fetch_item()
SIGNAL_HANDLER
SHOULD_CALL_PARENT(TRUE)
UnregisterSignal(helditem, COMSIG_ITEM_DROPPED)
implant_owner.temporarilyRemoveItemFromInventory(helditem)
helditem.forceMove(src)


/obj/item/implant/deployitem/blade
name = "mantis blade implant"
desc = "A large folding blade capable of being stored within an arm."
icon = 'icons/obj/items/weapons.dmi'
icon_state = "armblade"
helditem = /obj/item/weapon/mantisblade

/obj/item/implant/deployitem/blade/get_data()
return {"
<b>Implant Specifications:</b><BR>
<b>Name:</b> Nanotrasen MA-12 Mantis Implant<BR>
<HR>
<b>Implant Details:</b><BR>
<b>Function:</b> Upon activation, the user deploys a large blade from the their arm.<BR>"}

/obj/item/implant/deployitem/blade/put_in_slots()
. = ..()
playsound(implant_owner, 'sound/weapons/wristblades_on.ogg', 15, 0, 1)

/obj/item/implant/deployitem/blade/fetch_item()
. = ..()
playsound(implant_owner, 'sound/weapons/wristblades_off.ogg', 15, 0, 1)

/obj/item/weapon/mantisblade
name = "mantis arm blade"
desc = "A wicked-looking folding blade capable of being concealed within a human's arm."
icon_state = "armblade"
item_state = "armblade"
force = 60
flags_atom = CONDUCT
flags_equip_slot = NONE
w_class = WEIGHT_CLASS_BULKY //not needed but just in case why not
sharp = IS_SHARP_ITEM_BIG
hitsound = 'sound/weapons/slash.ogg'
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
4 changes: 4 additions & 0 deletions code/game/objects/items/implants/implanter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@
/obj/item/implanter/cloak
name = "cloak implant implanter"
imp = /obj/item/implant/cloak

/obj/item/implanter/blade
name = "blade implant implanter"
imp = /obj/item/implant/deployitem/blade
Binary file modified icons/mob/items_lefthand_0.dmi
Binary file not shown.
Binary file modified icons/mob/items_righthand_0.dmi
Binary file not shown.
Binary file modified icons/obj/items/weapons.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions tgmc.dme
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@
#include "code\game\objects\items\implants\implant.dm"
#include "code\game\objects\items\implants\implant_chem.dm"
#include "code\game\objects\items\implants\implant_cloak.dm"
#include "code\game\objects\items\implants\implant_items.dm"
#include "code\game\objects\items\implants\implant_neurostim.dm"
#include "code\game\objects\items\implants\implantcase.dm"
#include "code\game\objects\items\implants\implantchair.dm"
Expand Down