Give implants an action button

Because spells for this is dumb

Featuring activation buttons that totally are 100% coderart.
This commit is contained in:
MrPerson
2014-10-06 21:05:09 -07:00
parent 291203994e
commit dea5cc4bcb
6 changed files with 61 additions and 80 deletions
+1
View File
@@ -217,6 +217,7 @@
var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob)
E.imp_in = synd_mob
E.implanted = 1
E.implanted(synd_mob)
synd_mob.faction |= "syndicate"
synd_mob.update_icons()
return 1
@@ -1,7 +1,8 @@
/obj/item/weapon/implant
name = "implant"
icon = 'icons/obj/stock_parts.dmi'
icon_state = "rom"//Normally, you shouldn't see these. However, they can show up in the game via certain sources, like soul-stoning.
icon = 'icons/obj/implants.dmi'
icon_state = "generic" //Shows up as the action button icon
var/activated = 1 //1 for implant types that can be activated, 0 for ones that are "always on" like loyalty implants
var/implanted = null
var/mob/imp_in = null
item_color = "b"
@@ -15,11 +16,16 @@
/obj/item/weapon/implant/proc/activate()
return
/obj/item/weapon/implant/ui_action_click()
activate("action_button")
//What does the implant do upon injection?
//return 0 if the implant fails (ex. Revhead and loyalty implant.)
//return 1 if the implant succeeds (ex. Nonrevhead and loyalty implant.)
/obj/item/weapon/implant/proc/implanted(var/mob/source)
if(activated)
action_button_name = "Activate [src.name]"
return 1
@@ -34,6 +40,7 @@
/obj/item/weapon/implant/tracking
name = "tracking implant"
desc = "Track with this."
activated = 0
var/id = 1.0
/obj/item/weapon/implant/tracking/get_data()
@@ -58,6 +65,7 @@
/obj/item/weapon/implant/explosive
name = "explosive implant"
desc = "And boom goes the weasel."
icon_state = "explosive"
/obj/item/weapon/implant/explosive/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -77,6 +85,8 @@
/obj/item/weapon/implant/explosive/activate(var/cause)
if(!cause || !imp_in) return 0
if(cause == "action_button" && alert(imp_in, "Are you sure you want to activate your explosive implant? This will cause you to explode and gib!", "Explosive Implant Confirmation", "Yes", "No") != "Yes")
return 0
explosion(src, -1, 0, 2, 3, 0) //This might be a bit much, dono will have to see.
if(imp_in)
imp_in.gib()
@@ -85,6 +95,7 @@
/obj/item/weapon/implant/chem
name = "chem implant"
desc = "Injects things."
icon_state = "reagents"
allow_reagents = 1
/obj/item/weapon/implant/chem/get_data()
@@ -125,6 +136,7 @@
/obj/item/weapon/implant/loyalty
name = "loyalty implant"
desc = "Makes you loyal or such."
activated = 0
/obj/item/weapon/implant/loyalty/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -140,6 +152,7 @@
/obj/item/weapon/implant/loyalty/implanted(mob/target)
..()
if(target.mind in ticker.mode.head_revolutionaries)
target.visible_message("<span class='warning'>[target] seems to resist the implant!</span>", "<span class='warning'>You feel the corporate tendrils of Nanotrasen try to invade your mind!</span>")
return 0
@@ -152,6 +165,7 @@
/obj/item/weapon/implant/adrenalin
name = "adrenal implant"
desc = "Removes all stuns and knockdowns."
icon_state = "adrenal"
var/uses = 3
/obj/item/weapon/implant/adrenalin/get_data()
@@ -165,47 +179,29 @@
<b>Integrity:</b> Implant can only be used three times before reserves are depleted."}
return dat
/obj/item/weapon/implant/adrenalin/trigger(emote, mob/source)
/obj/item/weapon/implant/adrenalin/activate()
if(uses < 1) return 0
if(emote == "scream")
uses--
source << "<span class='notice'>You feel a sudden surge of energy!</span>"
source.SetStunned(0)
source.SetWeakened(0)
source.SetParalysis(0)
source.lying = 0
source.update_canmove()
uses--
imp_in << "<span class='notice'>You feel a sudden surge of energy!</span>"
imp_in.SetStunned(0)
imp_in.SetWeakened(0)
imp_in.SetParalysis(0)
imp_in.lying = 0
imp_in.update_canmove()
source.reagents.add_reagent("synaptizine", 10)
source.reagents.add_reagent("tricordrazine", 10)
source.reagents.add_reagent("hyperzine", 10)
/obj/item/weapon/implant/adrenalin/implanted(mob/source)
source.mind.store_memory("An adrenal implant can be activated [uses] time\s by using the scream emote, <B>say *scream</B> to attempt to activate.", 0, 0)
source << "<span class='notice'>The implanted adrenaline implant can be activated [uses] time\s by using the scream emote, <B>say *scream</B> to attempt to activate.</span>"
return 1
imp_in.reagents.add_reagent("synaptizine", 10)
imp_in.reagents.add_reagent("tricordrazine", 10)
imp_in.reagents.add_reagent("hyperzine", 10)
/obj/item/weapon/implant/emp
name = "emp implant"
desc = "Triggers an EMP."
icon_state = "emp"
var/activation_emote = "chuckle"
var/uses = 2
/obj/item/weapon/implant/emp/New()
activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "smile", "pale", "sniff", "whimper", "wink")
..()
return
/obj/item/weapon/implant/emp/trigger(emote, mob/living/carbon/source as mob)
/obj/item/weapon/implant/emp/activate()
if (src.uses < 1) return 0
if (emote == src.activation_emote)
src.uses--
empulse(source, 3, 5)
return
/obj/item/weapon/implant/emp/implanted(mob/living/carbon/source)
source.mind.store_memory("EMP implant can be activated [uses] time\s by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted EMP implant can be activated [uses] time\s by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate."
return 1
src.uses--
empulse(imp_in, 3, 5)
@@ -3,52 +3,39 @@
/obj/item/weapon/implant/freedom
name = "freedom implant"
desc = "Use this to escape from those evil Red Shirts."
icon_state = "freedom"
item_color = "r"
var/activation_emote = "chuckle"
var/uses = 4.0
/obj/item/weapon/implant/freedom/New()
src.activation_emote = "shrug"
src.uses = 4
..()
return
/obj/item/weapon/implant/freedom/trigger(emote, mob/living/carbon/source as mob)
/obj/item/weapon/implant/freedom/activate()
if (src.uses < 1) return 0
if (emote == src.activation_emote)
src.uses--
source << "You feel a faint click."
if (source.handcuffed)
var/obj/item/weapon/W = source.handcuffed
source.handcuffed = null
source.update_inv_handcuffed(0)
if (source.client)
source.client.screen -= W
src.uses--
imp_in << "You feel a faint click."
if(iscarbon(imp_in))
var/mob/living/carbon/C_imp_in = imp_in
if (C_imp_in.handcuffed)
var/obj/item/weapon/W = C_imp_in.handcuffed
C_imp_in.handcuffed = null
C_imp_in.update_inv_handcuffed(0)
if (C_imp_in.client)
C_imp_in.client.screen -= W
if (W)
W.loc = source.loc
dropped(source)
W.loc = C_imp_in.loc
W.dropped(C_imp_in)
if (W)
W.layer = initial(W.layer)
if (source.legcuffed)
var/obj/item/weapon/W = source.legcuffed
source.legcuffed = null
source.update_inv_legcuffed(0)
if (source.client)
source.client.screen -= W
if (C_imp_in.legcuffed)
var/obj/item/weapon/W = C_imp_in.legcuffed
C_imp_in.legcuffed = null
C_imp_in.update_inv_legcuffed(0)
if (C_imp_in.client)
C_imp_in.client.screen -= W
if (W)
W.loc = source.loc
dropped(source)
W.loc = C_imp_in.loc
W.dropped(C_imp_in)
if (W)
W.layer = initial(W.layer)
return
/obj/item/weapon/implant/freedom/implanted(mob/living/carbon/source)
source.mind.store_memory("Freedom implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted freedom implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate."
return 1
/obj/item/weapon/implant/freedom/get_data()
@@ -1,24 +1,20 @@
/obj/item/weapon/implant/uplink
name = "uplink implant"
desc = "Summon things."
var/activation_emote = "chuckle"
icon = 'icons/obj/radio.dmi'
icon_state = "radio"
/obj/item/weapon/implant/uplink/New()
activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
hidden_uplink = new(src)
hidden_uplink.uses = 10
..()
return
/obj/item/weapon/implant/uplink/implanted(mob/source)
activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
source.mind.store_memory("Uplink implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted uplink implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate."
..()
hidden_uplink.uplink_owner="[source.key]"
return 1
/obj/item/weapon/implant/uplink/trigger(emote, mob/source as mob)
if(hidden_uplink && usr == source) // Let's not have another people activate our uplink
hidden_uplink.check_trigger(source, emote, activation_emote)
return
/obj/item/weapon/implant/uplink/activate()
if(hidden_uplink)
hidden_uplink.check_trigger(imp_in)
+1
View File
@@ -13,6 +13,7 @@
/obj/item/weapon/implant/exile
name = "exile implant"
desc = "Prevents you from returning from away missions"
activated = 0
/obj/item/weapon/implant/exile/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB