From dea5cc4bcbd7ea37763bd4594cfcc9b55be0aff8 Mon Sep 17 00:00:00 2001 From: MrPerson Date: Mon, 6 Oct 2014 21:05:09 -0700 Subject: [PATCH] Give implants an action button Because spells for this is dumb Featuring activation buttons that totally are 100% coderart. --- code/game/gamemodes/nuclear/nuclear.dm | 1 + .../objects/items/weapons/implants/implant.dm | 66 ++++++++---------- .../items/weapons/implants/implantfreedom.dm | 57 ++++++--------- .../items/weapons/implants/implantuplink.dm | 16 ++--- code/modules/awaymissions/exile.dm | 1 + icons/obj/implants.dmi | Bin 0 -> 2159 bytes 6 files changed, 61 insertions(+), 80 deletions(-) create mode 100644 icons/obj/implants.dmi diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index f0c1de856b8..b835b477661 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -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 diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 18b9563867c..0689a85593b 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -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 = {"Implant Specifications:
@@ -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 = {"Implant Specifications:
@@ -140,6 +152,7 @@ /obj/item/weapon/implant/loyalty/implanted(mob/target) + ..() if(target.mind in ticker.mode.head_revolutionaries) target.visible_message("[target] seems to resist the implant!", "You feel the corporate tendrils of Nanotrasen try to invade your mind!") 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 @@ Integrity: 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 << "You feel a sudden surge of energy!" - source.SetStunned(0) - source.SetWeakened(0) - source.SetParalysis(0) - source.lying = 0 - source.update_canmove() + uses-- + imp_in << "You feel a sudden surge of energy!" + 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, say *scream to attempt to activate.", 0, 0) - source << "The implanted adrenaline implant can be activated [uses] time\s by using the scream emote, say *scream to attempt to activate." - 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, say *[src.activation_emote] to attempt to activate.", 0, 0) - source << "The implanted EMP implant can be activated [uses] time\s by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." - return 1 \ No newline at end of file + src.uses-- + empulse(imp_in, 3, 5) \ No newline at end of file diff --git a/code/game/objects/items/weapons/implants/implantfreedom.dm b/code/game/objects/items/weapons/implants/implantfreedom.dm index fdf63866f6b..db9f3a17c06 100644 --- a/code/game/objects/items/weapons/implants/implantfreedom.dm +++ b/code/game/objects/items/weapons/implants/implantfreedom.dm @@ -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, say *[src.activation_emote] to attempt to activate.", 0, 0) - source << "The implanted freedom implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] to attempt to activate." - return 1 /obj/item/weapon/implant/freedom/get_data() diff --git a/code/game/objects/items/weapons/implants/implantuplink.dm b/code/game/objects/items/weapons/implants/implantuplink.dm index e3cae95152e..74a2b365aa9 100644 --- a/code/game/objects/items/weapons/implants/implantuplink.dm +++ b/code/game/objects/items/weapons/implants/implantuplink.dm @@ -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, say *[src.activation_emote] to attempt to activate.", 0, 0) - source << "The implanted uplink implant can be activated by using the [src.activation_emote] emote, say *[src.activation_emote] 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 \ No newline at end of file +/obj/item/weapon/implant/uplink/activate() + if(hidden_uplink) + hidden_uplink.check_trigger(imp_in) \ No newline at end of file diff --git a/code/modules/awaymissions/exile.dm b/code/modules/awaymissions/exile.dm index 5f59848bf65..731c7faf252 100644 --- a/code/modules/awaymissions/exile.dm +++ b/code/modules/awaymissions/exile.dm @@ -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 = {"Implant Specifications:
diff --git a/icons/obj/implants.dmi b/icons/obj/implants.dmi new file mode 100644 index 0000000000000000000000000000000000000000..ed530528cc35dbbaf60baeb7636ab419b000e365 GIT binary patch literal 2159 zcmV-#2$1)QP)WB+Ib|7;Nd zfi?ed7XN4k>ZxJ-xp2~XJpXC{|7i)H4G>LDP5);D`?+@e!Giw9i~h@v{(}JjcmV%y z0I?|`*p7Vvb|U?~fc~HZ{i+H5u?_vQ4*stU{ig^1oC5xg0RDXd;)+w~sb>F^Q5+l` z$8$aX%Od2LaL;d5^}2oVqin-{T>ozs|J1uKE-wCe0RMC#|7!sM!FKbhR=H&}wPGjq zvQy`iNB?OD|B_H{Zf^f_0RDym-IYh`n?&!VV5d$Q|JIiNzg7v{k#?baRC36RGk0<{(AualmYgoP5sIt z^`%w(wt|;CGk+Nx{lXglbO8To0RL+1sFe&S-g7TX<`L0{< zr&|7X001-p|EYHMrAGgA0ROCdXB3be=`4P1pasc{-XumpI82y0{(>n|G}NbV>JGW0RM9z|7i%T6%NmEM%HLJ z{-+22sR-GieE)0!|EF{RdMf{D2mWmU{)+&sDJlPJ4cCrK|8xNIwTrS=Iq#Z2{>_*E z)}6wDJp7$B^p-ZsgEs&FGyngY0A>I)W;5*_&{6;Z00DGTPE!Ct=GbNc0066cR9JLG zWpiV4X>fFDZ*Bkpc$|fhy9&cF3`J-AD@?M6()6`;2?-@b^9#krif!- z4X)88>xTCGw+}QrTYytlHHrWL1lUPLK~z|U?U;*K+f*39V+&$7r?#up79WMtI&EY_ z8KXMers#%m$H3qwVz&{WVKQMcgRwbXr}!?!PFv@EO&qB6F<%qk&-vEb!hhqvNt@>8 z-UKoZM~`RUfkVjG{C@YlulAOr{$p{HV{ZA*vhtHFP5~G6-0;Z9Zc;+jCvalw)c z7he>jYz_lv!1>I@wVtKRfCa)wzp-ah}9b?a~KXuhqowexnHy~L@#6o~+SB9TCH8#YEaRdn&ZyZw$k zJ6gN$y1Q)=eb2r23INOqG;n|~fIt-8^`Y*~!TWlGTPpAG?c=vPM3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