From 6b04aaf96406ceccdc6dc49fe2709d043b866da0 Mon Sep 17 00:00:00 2001 From: Doru991 <75124791+Doru991@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:52:49 +0300 Subject: [PATCH] Potato battery update + potato AI (#21142) Co-authored-by: metalgearsloth --- .../Containers/ItemSlot/ItemSlotsComponent.cs | 3 + .../Containers/ItemSlot/ItemSlotsSystem.cs | 2 +- Resources/Locale/en-US/pai/pai-system.ftl | 2 + .../Objects/Consumable/Food/produce.yml | 3 + .../Prototypes/Entities/Objects/Fun/pai.yml | 29 +++++++ .../Entities/Objects/Misc/potatoai_chip.yml | 17 ++++ .../Entities/Objects/Power/powercells.yml | 11 ++- .../Objects/Specific/Robotics/mmi.yml | 2 +- .../Entities/Structures/Power/chargers.yml | 3 + .../Crafting/Graphs/improvised/potato.yml | 74 ++++++++++++++++++ .../Prototypes/Recipes/Crafting/potato.yml | 32 ++++++++ Resources/Prototypes/tags.yml | 9 +++ .../Objects/Fun/pai.rsi/icon-potato-off.png | Bin 0 -> 483 bytes .../Textures/Objects/Fun/pai.rsi/meta.json | 17 +++- .../Objects/Fun/pai.rsi/potato-base.png | Bin 0 -> 476 bytes .../Fun/pai.rsi/potato-off-overlay.png | Bin 0 -> 162 bytes .../Objects/Fun/pai.rsi/potato-on-overlay.png | Bin 0 -> 159 bytes .../Fun/pai.rsi/potato-searching-overlay.png | Bin 0 -> 186 bytes .../Objects/Misc/potatoai_chip.rsi/icon.png | Bin 0 -> 235 bytes .../Objects/Misc/potatoai_chip.rsi/meta.json | 14 ++++ .../Objects/Power/power_cells.rsi/meta.json | 2 +- .../Objects/Power/power_cells.rsi/potato.png | Bin 946 -> 463 bytes .../Specific/Robotics/mmi.rsi/meta.json | 2 +- 23 files changed, 215 insertions(+), 7 deletions(-) create mode 100644 Resources/Prototypes/Entities/Objects/Misc/potatoai_chip.yml create mode 100644 Resources/Prototypes/Recipes/Crafting/Graphs/improvised/potato.yml create mode 100644 Resources/Prototypes/Recipes/Crafting/potato.yml create mode 100644 Resources/Textures/Objects/Fun/pai.rsi/icon-potato-off.png create mode 100644 Resources/Textures/Objects/Fun/pai.rsi/potato-base.png create mode 100644 Resources/Textures/Objects/Fun/pai.rsi/potato-off-overlay.png create mode 100644 Resources/Textures/Objects/Fun/pai.rsi/potato-on-overlay.png create mode 100644 Resources/Textures/Objects/Fun/pai.rsi/potato-searching-overlay.png create mode 100644 Resources/Textures/Objects/Misc/potatoai_chip.rsi/icon.png create mode 100644 Resources/Textures/Objects/Misc/potatoai_chip.rsi/meta.json diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs index effba18210..9310617634 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsComponent.cs @@ -71,6 +71,9 @@ namespace Content.Shared.Containers.ItemSlots [DataField("whitelist")] public EntityWhitelist? Whitelist; + [DataField("blacklist")] + public EntityWhitelist? Blacklist; + [DataField("insertSound")] public SoundSpecifier InsertSound = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/revolver_magin.ogg"); diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs index 902b56427a..9194a8208e 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs @@ -255,7 +255,7 @@ namespace Content.Shared.Containers.ItemSlots if (!swap && slot.HasItem) return false; - if (slot.Whitelist != null && !slot.Whitelist.IsValid(usedUid)) + if ((slot.Whitelist != null && !slot.Whitelist.IsValid(usedUid)) || (slot.Blacklist != null && slot.Blacklist.IsValid(usedUid))) { if (_netManager.IsClient && _timing.IsFirstTimePredicted && popup.HasValue && !string.IsNullOrWhiteSpace(slot.WhitelistFailPopup)) _popupSystem.PopupEntity(Loc.GetString(slot.WhitelistFailPopup), uid, popup.Value); diff --git a/Resources/Locale/en-US/pai/pai-system.ftl b/Resources/Locale/en-US/pai/pai-system.ftl index d8ee6eaa08..d64d7f5623 100644 --- a/Resources/Locale/en-US/pai/pai-system.ftl +++ b/Resources/Locale/en-US/pai/pai-system.ftl @@ -9,6 +9,8 @@ pai-system-role-description = Be someone's electronic pal! pai-system-role-name-syndicate = Syndicate personal ai pai-system-role-description-syndicate = Be someone's Syndicate pal! (Memories *not* included.) +pai-system-role-name-potato = potato artificial intelligence +pai-system-role-description-potato = It's a toy for children. And now you live in it. pai-system-wipe-device-verb-text = Remove pAI pai-system-wiped-device = The pAI was wiped from the device. diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index 699997c123..6439b2eb6c 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -556,6 +556,9 @@ reagents: - ReagentId: JuicePotato Quantity: 10 + - type: Tag + tags: + - Potato - type: entity name: tomato diff --git a/Resources/Prototypes/Entities/Objects/Fun/pai.yml b/Resources/Prototypes/Entities/Objects/Fun/pai.yml index 6c0dc8f4ba..b9da6775c9 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/pai.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/pai.yml @@ -80,6 +80,7 @@ - state: pai-base - state: syndicate-pai-off-overlay shader: unshaded + map: ["screen"] - type: ToggleableGhostRole roleName: pai-system-role-name-syndicate roleDescription: pai-system-role-description-syndicate @@ -98,6 +99,34 @@ Searching: { state: syndicate-pai-searching-overlay } On: { state: syndicate-pai-on-overlay } +- type: entity + parent: PersonalAI + id: PotatoAI + name: potato artificial intelligence + description: It's a potato. You forced it to be sentient, you monster. + components: + - type: Sprite + sprite: Objects/Fun/pai.rsi + layers: + - state: potato-base + - state: potato-off-overlay + shader: unshaded + map: ["screen"] + - type: ToggleableGhostRole + roleName: pai-system-role-name-potato + roleDescription: pai-system-role-description-potato + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ToggleableGhostRoleVisuals.Status: + screen: + Off: { state: potato-off-overlay } + Searching: { state: potato-searching-overlay } + On: { state: potato-on-overlay } + - type: Construction + graph: PotatoAI + node: potatoai + - type: entity id: ActionPAIPlayMidi name: Play MIDI diff --git a/Resources/Prototypes/Entities/Objects/Misc/potatoai_chip.yml b/Resources/Prototypes/Entities/Objects/Misc/potatoai_chip.yml new file mode 100644 index 0000000000..528aa30a14 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Misc/potatoai_chip.yml @@ -0,0 +1,17 @@ +- type: entity + id: PotatoAIChip + name: supercompact AI chip + parent: BaseItem + description: This high-tech AI chip requires a voltage of exactly 1.1V to function correctly. + components: + - type: Sprite + sprite: Objects/Misc/potatoai_chip.rsi + state: icon + - type: Item + size: 3 + - type: Tag + tags: + - SmallAIChip + - type: Construction + graph: PotatoAIChip + node: potatoaichip \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Power/powercells.yml b/Resources/Prototypes/Entities/Objects/Power/powercells.yml index 82c1bb37e9..4ed3e207c5 100644 --- a/Resources/Prototypes/Entities/Objects/Power/powercells.yml +++ b/Resources/Prototypes/Entities/Objects/Power/powercells.yml @@ -42,8 +42,15 @@ layers: - state: potato - type: Battery - maxCharge: 200 - startingCharge: 200 + maxCharge: 70 + startingCharge: 70 + - type: Tag + tags: + - DroneUsable + - PotatoBattery + - type: Construction + graph: PowerCellPotato + node: potatobattery - type: entity name: small-capacity power cell diff --git a/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml b/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml index 6382d69e58..b4e69b3780 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml @@ -116,4 +116,4 @@ base: Off: { state: posibrain } Searching: { state: posibrain-searching } - On: { state: posibrain-occupied } + On: { state: posibrain-occupied } \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Power/chargers.yml b/Resources/Prototypes/Entities/Structures/Power/chargers.yml index e5edc63df3..7630610bd8 100644 --- a/Resources/Prototypes/Entities/Structures/Power/chargers.yml +++ b/Resources/Prototypes/Entities/Structures/Power/chargers.yml @@ -85,6 +85,9 @@ whitelist: components: - PowerCell + blacklist: + tags: + - PotatoBattery - type: entity parent: BaseItemRecharger diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/improvised/potato.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/improvised/potato.yml new file mode 100644 index 0000000000..e3f972cfda --- /dev/null +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/improvised/potato.yml @@ -0,0 +1,74 @@ +- type: constructionGraph + id: PowerCellPotato + start: start + graph: + - node: start + edges: + - to: potatobattery + steps: + - tag: Potato + name: a potato + icon: + sprite: Objects/Specific/Hydroponics/potato.rsi + state: produce + doAfter: 1 + - material: MetalRod + amount: 2 + doAfter: 1 + - material: Cable + amount: 1 + doAfter: 1 + - node: potatobattery + entity: PowerCellPotato + +- type: constructionGraph + id: PotatoAI + start: start + graph: + - node: start + edges: + - to: potatoai + steps: + - tag: PotatoBattery + name: a potato battery + icon: + sprite: Objects/Power/power_cells.rsi + state: potato + doAfter: 1 + - tag: SmallAIChip + name: a super-compact AI chip + icon: + sprite: Objects/Misc/potatoai_chip.rsi + state: icon + - node: potatoai + entity: PotatoAI + +- type: constructionGraph + id: PotatoAIChip + start: start + graph: + - node: start + edges: + - to: potatoaichip + steps: + - material: Steel + amount: 1 + doAfter: 1 + - material: Glass + amount: 1 + doAfter: 1 + - material: Cable + amount: 2 + doAfter: 1 + - tag: CapacitorStockPart + name: capacitor + icon: + sprite: Objects/Misc/stock_parts.rsi + state: capacitor + - tag: CapacitorStockPart + name: capacitor + icon: + sprite: Objects/Misc/stock_parts.rsi + state: capacitor + - node: potatoaichip + entity: PotatoAIChip \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Crafting/potato.yml b/Resources/Prototypes/Recipes/Crafting/potato.yml new file mode 100644 index 0000000000..17f2cc4013 --- /dev/null +++ b/Resources/Prototypes/Recipes/Crafting/potato.yml @@ -0,0 +1,32 @@ +- type: construction + name: potato battery + id: PowerCellPotato + graph: PowerCellPotato + startNode: start + targetNode: potatobattery + category: construction-category-misc + description: A truly ingenious source of power. + icon: { sprite: Objects/Power/power_cells.rsi, state: potato } + objectType: Item + +- type: construction + name: potato artificial intelligence + id: PotatoAI + graph: PotatoAI + startNode: start + targetNode: potatoai + category: construction-category-misc + description: The potato happens to be the perfect power source for this chip. + icon: { sprite: Objects/Fun/pai.rsi, state: icon-potato-off } + objectType: Item + +- type: construction + name: supercompact AI chip + id: PotatoAIChip + graph: PotatoAIChip + startNode: start + targetNode: potatoaichip + category: construction-category-misc + description: A masterfully(?) crafted AI chip, requiring a similarly improvised power source. + icon: { sprite: Objects/Misc/potatoai_chip.rsi, state: icon } + objectType: Item \ No newline at end of file diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index a74fde7710..67a27be416 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -839,6 +839,12 @@ - type: Tag id: PlushieSharkGrey +- type: Tag + id: Potato + +- type: Tag + id: PotatoBattery + - type: Tag id: PowerCellSmall @@ -924,6 +930,9 @@ - type: Tag id: SkeletonMotorcycleKeys +- type: Tag + id: SmallAIChip + - type: Tag id: SmallMech diff --git a/Resources/Textures/Objects/Fun/pai.rsi/icon-potato-off.png b/Resources/Textures/Objects/Fun/pai.rsi/icon-potato-off.png new file mode 100644 index 0000000000000000000000000000000000000000..806d02d6f3d43be3a12c9ba6f97bb64bbc48a83e GIT binary patch literal 483 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCik*1AIbUZKjy$OZ38X6k5bo+It8O{o2m{)1PuFYyJYFtWAq35p`-R(<^cYeRH;1SDy;VD5;+iVz& zZZ=$s>QM|iHp9{L>2iU^GsUzN?(Uwz6MWS-I(+BxR`)sV9-ddvJ?p(HlDxg*n9=mr zDmT*Xve!mmzF^<_RE;y`^|qC|#m|d)TyCthT3+6#>+$#2^FL2{`x*~B`p-X?(NzuR1fqggQu&X%Q~loCIEIS*`)vg literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Fun/pai.rsi/meta.json b/Resources/Textures/Objects/Fun/pai.rsi/meta.json index 905a3684f8..f819450aa8 100644 --- a/Resources/Textures/Objects/Fun/pai.rsi/meta.json +++ b/Resources/Textures/Objects/Fun/pai.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/9ddb8cf084e292571d4e9c79745db25befbd82fe. pai-searching-overlay heavily modified. Syndicate variants by fedKotikeD", + "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/9ddb8cf084e292571d4e9c79745db25befbd82fe. pai-searching-overlay heavily modified. Syndicate variants by fedKotikeD, and potato by Doru991", "size": { "x": 32, "y": 32 @@ -13,6 +13,9 @@ { "name": "pai-base" }, + { + "name": "potato-base" + }, { "name": "pai-off-overlay" }, @@ -57,6 +60,18 @@ 0.8 ] ] + }, + { + "name": "icon-potato-off" + }, + { + "name": "potato-off-overlay" + }, + { + "name": "potato-on-overlay" + }, + { + "name": "potato-searching-overlay" } ] } diff --git a/Resources/Textures/Objects/Fun/pai.rsi/potato-base.png b/Resources/Textures/Objects/Fun/pai.rsi/potato-base.png new file mode 100644 index 0000000000000000000000000000000000000000..b6e594430cd2bbb9ea259989541f8488b27329d3 GIT binary patch literal 476 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCikL1AIbUZKjy$ak!Iy+67&|8>O zU}a^sZ*tI_CDY#>%qq#rdbulUSEcCx+mjj^8n$%%b*3543T2pAX}_+~ra!}AS-s2p z78jrmpL{-T22%1RL4Lvi@dAdkl4SxwrJMyGk;M!Qd;={+1ukXCw{J?tR zy>@2bzriA%)PZ3>^b4{l4pWM{KtInbjFp00i_>zopr09{|xfB*mh literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Fun/pai.rsi/potato-off-overlay.png b/Resources/Textures/Objects/Fun/pai.rsi/potato-off-overlay.png new file mode 100644 index 0000000000000000000000000000000000000000..0d3f73515881919ee768f51983ede0326c453966 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=Dh+L6~vJ#O${~L32+R$B+p3x5pRqG8k~MUX=GSKae>4-G13+ zR}2`pen0b+h2e+b#?ya8-glI`8~JA6wF7EOaH@*RX5Bh#!-eBO9)qW=pUXO@geCw) C4KgDD literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Fun/pai.rsi/potato-on-overlay.png b/Resources/Textures/Objects/Fun/pai.rsi/potato-on-overlay.png new file mode 100644 index 0000000000000000000000000000000000000000..9926823662aa4a81604e6d89d32e93c3aa436e96 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=Dh+L6~vJ#O${~K@(3G$B+p3x92u;GAIbJ9Lzrv^u}*@XdH`n zfWfSjX1ll<;-=i&bZ(;h|J#p$AMs>h*defyVg3zopr0F8k! A&Hw-a literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Fun/pai.rsi/potato-searching-overlay.png b/Resources/Textures/Objects/Fun/pai.rsi/potato-searching-overlay.png new file mode 100644 index 0000000000000000000000000000000000000000..5d8d7cde30c3b830b6a68e733c93d39ecb5ffd04 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$1AIbUFRV2FeAFDsOL?R|6-Y6c1o;L3|Icv!6faOM180FpWHAE+-yslY z6xHx*019e*x;Tbd_$MbQF}R63Fr4I)kXXng;SheHVMEEi%Jg@qYP XF0ucfcJ*>H^-ePuXy&La6)GmqR*Bt{o|yVpx#5>~=$Fg?Nkl8UxnV@>AHGI{21kNH+>} S#{UPJ$>8bg=d#Wzp$Pyf^iT5u literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Misc/potatoai_chip.rsi/meta.json b/Resources/Textures/Objects/Misc/potatoai_chip.rsi/meta.json new file mode 100644 index 0000000000..dec5a8d3f7 --- /dev/null +++ b/Resources/Textures/Objects/Misc/potatoai_chip.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Drawn by @Doru991 for SS14", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + } + ] +} diff --git a/Resources/Textures/Objects/Power/power_cells.rsi/meta.json b/Resources/Textures/Objects/Power/power_cells.rsi/meta.json index 01c2300621..66dbf30841 100644 --- a/Resources/Textures/Objects/Power/power_cells.rsi/meta.json +++ b/Resources/Textures/Objects/Power/power_cells.rsi/meta.json @@ -5,7 +5,7 @@ "y": 32 }, "license": "CC-BY-SA-3.0", - "copyright": "https://github.com/tgstation/tgstation/commit/7dcdbc1468ffdc8689b984cb6b181d48ae41dbf2", + "copyright": "https://github.com/tgstation/tgstation/commit/7dcdbc1468ffdc8689b984cb6b181d48ae41dbf2, potato based on https://github.com/vgstation-coders/vgstation13/commit/1dbcf389b0ec6b2c51b002df5fef8dd1519f8068 edited by @Doru991", "states": [ { "name": "potato" diff --git a/Resources/Textures/Objects/Power/power_cells.rsi/potato.png b/Resources/Textures/Objects/Power/power_cells.rsi/potato.png index 5b0f7a5fe04b8b62f804fa629e1861933144196d..53572f46a122188df257488e291ff405b8d68d08 100644 GIT binary patch delta 448 zcmdnQex7-PWIZzj1B1(wu46!ou{g-xiDBJ2nU_EgOS+@4BLl<6e(pbstU!KXfKQ04 z%@h-z95pFNag{LnE!}=EcP0J5J?Y)Stc&w(YpaTVot>sk=q=1C*f%+7&XVct8f~ns ztV(jSc2$ZtG&FRk8O{o2m{)1vpJA}9-erA@3((Z%^;*aHfV6Z;kYDhBoPa^ygxeIT zjI+QavY3H^?=T269?xHq0u+4U>Eak-;s16*w@{OUfa}#Gu||_Q*8cd<|CVX>qs1TD ztOWl%j=oRZu$?ieum#nG-=a(Sh#WRtAECFa6We7c~&$a4+VY3ft&jY*;3Ow2ClP z7_M`RR@0JocM;NDF3ZK`e39NQ>Du14$?(m-aPYey&+qwuzkkp3%aa7|<9~+GXaWnY zRT6v3yC2a<6#*y(8A% zU4v_$Tk{T#jem|_>dm+6lA1HK1fJN6IWx< zLA0uXvC$E0lPtpZyNUbu?V*rW(Ppm^YFA*#b_!XQ(2nhV3DzrLe9U+%pCo_JL(t!fZsgH5l`C4haRC6u za*3{|?~qjt0VNV8=x?QB2o%dDg8o*Ayu}}&eEFuA)b0X0ZkTM@*2SsB38xiykA0#= zxPM!Ah>PVC#as?uQ!yTWn2#>Fk78E=2c{;4>B;Zu@9m*jF0rWTPLD(F3KOT#qh{vn z&g2&VCB3Mwlgl7XwZ5p8bOk)14!3Ylt|R6MlqMGBlqHdT>@+on?pgO4{b)0 z6?E;6%gb{a0OYX5@YfTb^KR%*!?B@3t022gsVlQr$M>-u{{f2{psVn%KTQAt002ov JPDHLkV1jHV*y#WO diff --git a/Resources/Textures/Objects/Specific/Robotics/mmi.rsi/meta.json b/Resources/Textures/Objects/Specific/Robotics/mmi.rsi/meta.json index 6499772c7a..fcdd9e1b26 100644 --- a/Resources/Textures/Objects/Specific/Robotics/mmi.rsi/meta.json +++ b/Resources/Textures/Objects/Specific/Robotics/mmi.rsi/meta.json @@ -76,4 +76,4 @@ ] } ] -} \ No newline at end of file +} -- 2.51.2