From d9ff72c9072c5d3e138cd3855803524d03284881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= <6766154+Zumorica@users.noreply.github.com> Date: Sun, 24 Mar 2019 18:05:32 +0100 Subject: [PATCH] Adds small lights and small light bulbs. (#156) In the future, someone might want to edit the sprites so the bulb is white and not yellow. Here's some screenshots: ![image](https://user-images.githubusercontent.com/6766154/54878560-d9242e80-4e2e-11e9-8fde-39ae082f34b0.png) ![image](https://user-images.githubusercontent.com/6766154/54878572-f3f6a300-4e2e-11e9-95a1-253a5504922f.png) --- .../Components/Power/LightBulbComponent.cs | 1 + .../Components/Power/PoweredLightComponent.cs | 10 +++- Resources/Maps/stationstation.yml | 8 ++-- Resources/Prototypes/Entities/Lights.yml | 42 +++++++++++++++++ .../Buildings/light_small.rsi/broken.png | Bin 0 -> 446 bytes .../Buildings/light_small.rsi/burned.png | Bin 0 -> 625 bytes .../Buildings/light_small.rsi/empty.png | Bin 0 -> 319 bytes .../Buildings/light_small.rsi/meta.json | 1 + .../Buildings/light_small.rsi/off.png | Bin 0 -> 478 bytes .../Textures/Buildings/light_small.rsi/on.png | Bin 0 -> 556 bytes .../Objects/light_bulb.rsi/broken.png | Bin 0 -> 222 bytes .../Objects/light_bulb.rsi/burned.png | Bin 0 -> 354 bytes .../Textures/Objects/light_bulb.rsi/meta.json | 44 ++++++++++++++++++ .../Objects/light_bulb.rsi/normal.png | Bin 0 -> 224 bytes 14 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 Resources/Textures/Buildings/light_small.rsi/broken.png create mode 100644 Resources/Textures/Buildings/light_small.rsi/burned.png create mode 100644 Resources/Textures/Buildings/light_small.rsi/empty.png create mode 100644 Resources/Textures/Buildings/light_small.rsi/meta.json create mode 100644 Resources/Textures/Buildings/light_small.rsi/off.png create mode 100644 Resources/Textures/Buildings/light_small.rsi/on.png create mode 100644 Resources/Textures/Objects/light_bulb.rsi/broken.png create mode 100644 Resources/Textures/Objects/light_bulb.rsi/burned.png create mode 100644 Resources/Textures/Objects/light_bulb.rsi/meta.json create mode 100644 Resources/Textures/Objects/light_bulb.rsi/normal.png diff --git a/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs b/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs index d5f56baaea..d7ab69e8c8 100644 --- a/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs +++ b/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs @@ -16,6 +16,7 @@ namespace Content.Server.GameObjects.Components.Power public enum LightBulbType { + Bulb, Tube, } diff --git a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs index 555ab4ea2b..e93ab3089e 100644 --- a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs @@ -187,7 +187,15 @@ namespace Content.Server.GameObjects.Components.Power if (!existed) // Insert a light tube if there wasn't any. { - _lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightTube")); + switch (BulbType) + { + case LightBulbType.Tube: + _lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightTube")); + break; + case LightBulbType.Bulb: + _lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightBulb")); + break; + } } } } diff --git a/Resources/Maps/stationstation.yml b/Resources/Maps/stationstation.yml index b0924ee8e8..07c5f87532 100644 --- a/Resources/Maps/stationstation.yml +++ b/Resources/Maps/stationstation.yml @@ -950,17 +950,17 @@ entities: pos: 4.5,-9.5 rot: -1.570796 rad type: Transform -- type: poweredlight +- type: poweredsmalllight components: - grid: 0 pos: -4,-7 - rot: -1.5707963267949 rad + rot: 1.5707963267949 rad type: Transform -- type: poweredlight +- type: poweredsmalllight components: - grid: 0 pos: 3,-7 - rot: -1.5707963267949 rad + rot: 1.5707963267949 rad type: Transform - type: poweredlight components: diff --git a/Resources/Prototypes/Entities/Lights.yml b/Resources/Prototypes/Entities/Lights.yml index c93e9463e3..fbcf4e8ac2 100644 --- a/Resources/Prototypes/Entities/Lights.yml +++ b/Resources/Prototypes/Entities/Lights.yml @@ -46,6 +46,32 @@ - type: PoweredLight load: 40 bulb: Tube + +- type: entity + name: Small Light + id: poweredsmalllight + parent: wall_light + components: + - type: Clickable + - type: BoundingBox + - type: Sprite + sprite: Buildings/light_small.rsi + state: off + + - type: Icon + sprite: Buildings/light_small.rsi + state: off + + - type: PointLight + energy: 1.0 + state: Off + + - type: PowerDevice + priority: Low + + - type: PoweredLight + load: 40 + bulb: Bulb - type: entity parent: BaseItem @@ -68,4 +94,20 @@ - type: Icon sprite: Objects/light_tube.rsi + state: normal + +- type: entity + parent: BaseLightbulb + name: Light Bulb + id: LightBulb + components: + - type: LightBulb + bulb: Bulb + + - type: Sprite + sprite: Objects/light_bulb.rsi + state: normal + + - type: Icon + sprite: Objects/light_bulb.rsi state: normal \ No newline at end of file diff --git a/Resources/Textures/Buildings/light_small.rsi/broken.png b/Resources/Textures/Buildings/light_small.rsi/broken.png new file mode 100644 index 0000000000000000000000000000000000000000..cb77054e031bf9bc62d15e2ed52e1401d43616e6 GIT binary patch literal 446 zcmV;v0YUzWP)D!J7zgk_%kjCO>PFG=i5dR$8qyOnky=y(M*p_2&+BVR_=8ICtYy5GR@W~fsIos`6GUi#^A zeO%(ShO7bC6H zx3gj7OBngJZfDzeTj$~Dr!N4&cx*MX79t`dA|fI(Wngl$Bz9$@4g(C7ov59owFx_te0P}@g8lNvt0DzHo1_0n zn5wGGvMiS5T@TVOj;G$Bir%2Q(>n?&)xw?a$ZR?TJXb)cy}(oTCQ&cB-2tPafG}L4 z(OlxrvMfGC#sToq@w zBeUnv>P*)ZX7%MnzW}*sJM#T)o)AI^A%qY@2qF7%uLFtyC6Y>%3hSD}?uL>8(0cVV zcPVqCxqx9tI6f(2?g#K(0RRw&t5gf)CGm>sn!*~*B>-SDuHfq1kKC<3u)}1?Fe8X! z36pUJo%SNln*M$9bk=rcW;^mu)7gF7X)^TsbiMNR`av4C5JCtcgb+dq;e}g>VfAJ9 z`(?(vf1g{eRsmRNjiaH!EnwktQ8ErqMX>~3Q&^|Hz}efcThGLePiGP4egNB%*~=H% zXN;MDfYq0o=L$GHir~2d8qFmp;|dHj+T;nnK^4>4I#>LDRe)40W9|od^S+3zzl6*$ zOFw>uO?W!@0|3}cl4EhW8Yj(Ct&Hg`>*_e20k$KvPake^d{Ttx3NXwF-SdO3XS(M% zxVWrxkJ-5$g1V+K!;Cgt`cH@8$Ls4+_C;yvE zsnjw>FZix=SHYP3-tPxoyh2LDyJ+=Or8Dk- z&+$JGx_$oc*>|i!hd_X)%l66dmYRkh;W65LVar^#$4-+A7cP4%a(nLCxAAu$e($gQ zkz?i|22$*xb@Sba`t|2SLsL&qO1*fsNO0D+-(TN+O`WxL#iXbCAAhd679AP$niFX8 z{pI?(#wnevIPOl?$v^NgW|d{xb+1dy-q|x|PPaLISiT8l-iHZw3|$l4E`Byi5drZ% MUHx3vIVCg!0DxVL1^@s6 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Buildings/light_small.rsi/meta.json b/Resources/Textures/Buildings/light_small.rsi/meta.json new file mode 100644 index 0000000000..93bb6510da --- /dev/null +++ b/Resources/Textures/Buildings/light_small.rsi/meta.json @@ -0,0 +1 @@ +{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "https://github.com/discordia-space/CEV-Eris/blob/2b969adc2dfd3e9621bf3597c5cbffeb3ac8c9f0/icons/obj/lighting.dmi", "states": [{"name": "broken", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "burned", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "empty", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "off", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "on", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]} \ No newline at end of file diff --git a/Resources/Textures/Buildings/light_small.rsi/off.png b/Resources/Textures/Buildings/light_small.rsi/off.png new file mode 100644 index 0000000000000000000000000000000000000000..884262b5ab6589cbf752b5363ddfca50843af3c5 GIT binary patch literal 478 zcmV<40U`d0P)44l0-yNBwW`OuIq{@ibRqmLg%-x+8&%q z>3W28J?eWH{U{4xRG%-REPRpWq1NgHmOlY)urdH;;R`Q_0RUbQW9%HD`xICi09CbF zHR?ZTX&lCtg@0V}-F}FN`wwg9qOIu$NJKz2d)7idVH|hNR z^aTKzOq@2xLPSJFL_|cU7%MH4Nt3&1I{<$EQmfae)9K(+yRI3ziCWny3ma#1zt(2C z*aA4E*{aRTNDw-|fn3q^{NelC>oK2@u1C1JeXL!Vf$BO4ou|Zh`yqhSgsRQzVtK3j zz5JAYyJX}QP}AsgQp<%?Ycreg0RU<{6XmbQHbGg^Dkt^ZCV1YCh=_=Yh=@Ay4KP=( UT>nD+f&c&j07*qoM6N<$g1-XaH2?qr literal 0 HcmV?d00001 diff --git a/Resources/Textures/Buildings/light_small.rsi/on.png b/Resources/Textures/Buildings/light_small.rsi/on.png new file mode 100644 index 0000000000000000000000000000000000000000..558b9ab5cb548ced090248d8440d3025d40d19b6 GIT binary patch literal 556 zcmV+{0@MA8P)Zq}7=<4d16LqJq;}{j$Pi^nZjc-zBU|QfY;cGifeclL-XcSgGUN;lNbUdxLlVhG z5aRN_C6;X=``P{-KmCA#gkdN=&l9fe3fFao=XoLwL(%42Z(R?rZ-h8}l;z8LkIQ*~ zw@nqRqj5bAAr1=wD`bujJIyOI2e8usKx|pdZ=LTMwF6XESa%l~B>;eTG*=%0>=eix zAHb^Uql{?+bdG5PBmiRAX@JbBYNZ%Z^ijqr0W52IDvFf|^~uY9l(4%VlzlNfGVKfS2g5JRyV-LI@#b+_ZiS{g=mxwg8QZuZrL6bJR2;+V}z0DhdTC_4HuZ1sT_0>~>onQkzdZtk`bLI@#*5JFy>r(}qz8mL1Ut-T7M zYM>5jwDv8)qA1D+Y5<^oK3~~xKLY@0^eZ#Jw9;R7=uH4=Rd4fp0nFyRTL0glue@+4 z{}(;(f<6VfO=_0OoU4~`Iq&hPPunDDRYq@$j{XSrmMLmk%aag?DxJNUXt$9#gTkvF;|pytn$)c60@x2sP|7Wo;tA+h^h zJ@;()o(&Ju6A}_OY^XfqVa{$-*OV~%b@e7$fd|E{fnjZpiJy36yK4NmF(){LwHe(H ze#5}V#?~e-|3l-_d8c*9Pob{ik^lk*t*OS(_x@;A20EC* M)78&qol`;+02eJ+T>t<8 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/light_bulb.rsi/burned.png b/Resources/Textures/Objects/light_bulb.rsi/burned.png new file mode 100644 index 0000000000000000000000000000000000000000..7f193b60116cbb26e59d3a1f448a1d6b7be1f719 GIT binary patch literal 354 zcmV-o0iFJdP)Y6h)6Q+X(758Wk~>pk^C81q=Vc7GdiJ#ae=>g+IW?&cZT9h!DiWEn;mzg%lzP ze!+seDvT(CT4VzjW8>P-ETnNxIq>ei^SBQT27}?h)1^BY)Ex;hWPbrLGxw;al}Tg1 zwHg1tHBZK5M*<|~)v|@_NtRb~95u7rA+o9iH@7X$PWxG3eP?vM1nh7aj1Yx+7W`vX zIrRXO6FtBuFCTpnZsYqUqVSx{t4P@#G)oxN9a$|~3=B?Dn7*J^iE%y2#@d~-o>mC~ z{H1T+Uau(@7s+%F6NR%{I;qa^=^1L3nEQtoLWs_tVZz?7jq6Dc_APCVQ~{hq{Ou)lCy0m z8iei#A7wnT(19;OG5m2q^ZAEw-ZMS<-TX*EVEKVhfd*V|2Q?&EK@MQZKdp1|!^?Rt QKqoVJy85}Sb4q9e0P<;1r2qf` literal 0 HcmV?d00001