BBFFZ|MhF2rsPsBWe-
z^+IY41?OFodO;jGuQNP^KZ;2#{-fNmSFc_*gOed|oR$DV5x+oIK|uz7mBhh3?)+@m
zKqr?3xPxNI5s#DCu9Z|)M(TpFxjVmr0vGt`M=Tb?ld~?T-eL^{FIXs>ALmnf{fl
zveQsOJQelZG=$&X1*a+@5rnT&&~z_Ny&$*XdqZ1v^m-5q12vD;Uq#dQ;op1SC(EkW
z5Rg?POQ{_5$LzH-uEWHIqZnOufikEoFc5D;8Km|H)?C
z%Tj))QJH;M?=4i$WcPm5OjCao&`7xsT$_4$f;tc+&Q?7R8GdRm-fEDCEE203O1;ja
zq$SB3WJviw|Mtq8pROqgrN;jeUSYsZeRuWE#P@lZ@swLzY^xekF_2q*#*R^l4GJZ5
z-?lzKjWa9sFuaa2jFYFBsZ)IG6en`5FxE-1l^0}JUO59iD*+qZL59kMzNdN^
z4uClB6T(X#D(XL7zy#l0jE`8E~qxE-S-rO2C1}5qe
z;IN9xPE+E0=RPP1$DcUUr^Tnk`L*1`bD?pglf4A|X{VgBITlil=4S_uj*TPFO)
z+e&(x0u)xxmy3J(X3)`8MM#{2%nyg>z_hbWRK1o#O1?DJYeVZNne8u4_3PZj%41L8CQMcew#*g8Lm(uY
zaG4))@v$C*{7qx9jOOcHmVv$^
z%^&X>D916?{^?WXzUW^m4$n*bV=cBNQw?DEaOp8P?9$Ejc`N%*0;7bjem7_m8cQ=)
zO9~@aTjdi`03$)Z-3GR`$;pyfFexpA9X{uO#f;8$4Z~n*~aN|-m-_1P{9}`f8xXrcp~B(lBO?TFpEte4DVf#A+3lA9yzGQo1(0CCaoMpU>_VThG&(X~y%<_u
zN851MBwdx$*Wc07dHXkw$f?`+`G6xR#n;$NYg?M@ECygTH7(l}6ZN9^thuO2!tYT2
z*I3>J=5HB1BFLgMp4N0$_1eaE=1C2I27L%*(a+EJgg3(ebXS0(`)QhK=oS?CD7`8u
z=m7mOeK-hW^1h#;O%VbuI%{=7hY41@0A$_tsW!tJkBxHQlS_zd$G-E6F^HQS71Aoa
z)~c)UP_IqRh+$6iwjEBUXy`qO!)
z2Yl@8cKLFf?TRwg$IK=eAT>#f{!C;6TYMxUl1-u9M$lF%*l*s=p^=ti_X|c?
z2+(>YP0Uvwk_0PnIbejamCb-8hAGWX>X?8U`01|rZd)ZE<(r(tf-+z)Kj~!!UtNCS
z3E+TBQ&~9vaGFt5u?5iJ19C`+xO#)pxLJ*Ycr(aIfIi#@o}u6W!Wa6o4v2_>PYmE{
za&28!lf(_;8o#0UOH^Z=o8P|eElP&KC6TXP6@qz{t$IiW@B|5qhB+nI$68A9afPFq
zQFmU`x*M%HsPGylHK{c(@3CAUQE>*h4Nx?zUfsox!?g(v&5-&}2o{*$5dFbI$6>t&
zlmTC+KO=*_VTita(6-0m1a=I{A@}6s*nU6L>!=Ny0h#6t{^CK9_28n#TFPBZ_K7wp
zkzJY8No2=o{pXHxiw0C>5bV5j-8A<-3IcE^{@PNH;-Z0v#lB~(8IGy4iI69_e1NgQ
z_&h`%yB?H+1QszcKBZ=9`yHp!-OJML36ywG5_It*W0KfFzW$_TGE3|`uy8yYE0dBGM$puj+Xh#d+8vowd$tF?cIL^kz#EA2&
z$Gh_i1m(BT)SGDWZJju0Ey+XB*W&C?w5#UkFLSp)hY|pv`;9-EYNn4}X#-7r_eqeG
zI5oN$0Lr$`iO-5)-w02V2iM-1|5Xxbte-tMq4hg0k;`h=s#&n!+Zu;6A*4UnIqGssy@aey4_%MyLM+dA)9_zkg@g^Pg>pGJl9@5Q?
zpzDga7;N&$8E773^Z>AmGaSW1JH;z$B3i8P|H^>IU0h&WCQ`au^>hH@5HOKJK4ylM
z;oEbmw8d9>k!nV~;iDxBYHc@&i8u+15gBJyiaTj*Whm%jF;#Yu%p?k{K}_0GghyL;
zLbU5f=;J3LMf`9mf$8(oksu-V^VMo!tA9wW2BFX*wVQA;mji^w0dK*y$XExm=OXl;
zQS;=aJ9SFTe*}sC)NakT^3Q|!x8R`oUeLP!OT0Ne4S?b=0K>Vmzp!X}98YqsPk0Lb
z!jzh)kbhuG<*a_;=m7^13pWZ8xJK^2pjL!X#o}XVYZ)y40%BV^&d&yu-x)j2)oYDE
zN}t@%huw;O{yiFebUVqGQBT_gy!A?^m(`VMuBI7Qg7zFYtKga*CoGE<)S&)TCelDt
zKYRkBuZ8RbCRB^w>w+hMhx~I73U$!Hpgy97Nm8~vC_jrgF;Ta-Gm(HPqJH5D5nqG{
zjKEhF2_hgHh%BoJ`N%;%?Hx!M43wtr&0ZL+h{#NvVW9gD=Th(ZZwtIGLG1P4Q;Y=*
zt}a}gMHgC94qE-*!5jz>66ZH>wz@w+0|;OoK{Zqj&?mCrU5n`u?{UuxC>f}HH34Gh
zkVQaa19JE&YXTJax}vu!c|A+0v-5coJwB#(&y+cYr$lE=tO;x~NlYyM)s^$A9@<
zjDLk+{B4jxSM8rvV_of4+ppS=dVR2dtKvb*jE+!eMw-HK4Zt+AEd^e=4g4utbo*p*
z!cX@aqk-pX{?3(Y2pgM|CP54AKdE3nIVqsZw_4{KEgxCe!xWGbcTprr&lJ?|hLhjk
zS56zsZdoQK>GUCHhMd7QRkMs(ILv7jHCKg*CVad)eC_KdWT
zDDJ4t#ua^LbM4=VKj`3CXh>;r8y$7jVh&&JcK!QCIMvs*lXNI*BZ4H>w5qkE?1QNZ
z=tIl@%E`=+92Ax|y&wD}^-P&is8wj6%=8?r5`}n~B;t6`whD`uU-m|T+)6ir8R1|x
zO)5}0D8G#s_4-@RyD7oVcNWA*0`G){%TQ*|`x$nOC
zcl%JrzoYFnpI2>x_-_K%EG$H2pnqtnK~`%jIijq;zX;1IOp(lX2&4l$w(PN(PNsm+
fzmT@j#Nd8=V_m<*eg|JogI&}!(k;@t_3-}ytnS-*
literal 1065
zcmeAS@N?(olHy`uVBq!ia0vp^2|(!3HFsniTN?sSQ;j5hX6E#mPmP1tppJc?=8{
zb9(#sa~(2}X?gxcv#+f8lD(E*1u2)N#HHl?u{`(8AOIWvC?|A<>DCSl6
z<%L<&|CHo=q!kNqq|e#wD{rcDs>#^**}}&`P9YN&Cf=F4f96D?b5)O-Rf^8Bt=G~0
zS-xGmNB#A$|BR_?Z%Y}!O_~wYawPJ}%!q?0{R-orbDyiKS|us8RAYbYQO_sGO=r)}
zxMMYW(L1e>+{5<9?eTJdA{L%vU|=@!ba4!+nDch_{=C};0`2u$U3x;oC0p)9N^+H~
zY|r@`qR@Zf?t@^F6PMCoBvh=s#>cv8)$I0^mtkj3O|`d7(|eP&Y11sNEy6zop6_$r
z!utArt(remWniF4!ix>1J0aF$W%Qg*H}!!%Q8Cj7K&wBtNLzyVBCE3%)89yV9h*5;~D
z_RNpgOl=kLn8d=cA!_Xf6W&J_-=0V4h*{q~arNp{)`srxZjB{--EFEY?d`WSY>3g5
z4{w-qX<6p0{a2!t`;tw3n@xNdZgrcr%-|S{d;~|M&gl=Iiu?3~6SmZK?^;(_Rn?{9
z2{gD&tf0r{eO=&nQ-&W8ta}VI{x4?CIa!#oc4OT7#GZp^&+-;bQ)Em?c+j?K*E-7|
z(*J}m96MPck-V*{@ib>>DC_sWWtkJ6Te8<5p4PBy-F7CGrC(0|+{eJJSfii0{jM0p
zBo)WVX#rk0k9(Xt-XMN~*N)+SnAgp14P{PclkWU0(|?&KyZgzcWc3%e33l_{-_3t(
z7ate*>)yqC*SDAMY-(R%&%!w&=+?L5y;ClQg|cccEj`?0$W}Sey*7HSDf@osC(l~$
z23+EuFy&HOpWg6=tKj5hRUY?z
zzJ#`R^%Uf&mB1e3NWx4Ko9vR7OKz0EyppwH^P&!?TfbvWSf_jy+}mBeTVoFcLk)M%
zfB!q7@(*9B#niS$i*E9-Z4th?wqK&e@5kLQd;d=PbLjPYlf8;x{s1-EX!hqa=1nwW
z*gq{a`|b7p?}Fqn9+h}p-LSggTe~DWM4f(rey(
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/isd/lance.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/isd/lance.dmi
index 96710b992658550a2719abfe8e62446d7a6fb7bd..b10ce2be13352d0f5f00e50b6344918cd3d8620c 100644
GIT binary patch
literal 4116
zcmbtX2UJs8x4sbs0U=-k1SJaCa1;=P0ERFOBcc>BC{>|JVB0%1Z9t`Ody~@BQs>pObXP(o|Ah
zK^y=8NwbqCX8`~LUIL#siGbfTKi8iDe=4GE?7~buL(w5V!C^i@fdCMh)z?!cby-7N
z}C2yUk2~wu#J|9SJ(=WUC-D?{zmUb)-O8!3|x#ic-+bgm}^N8%{T>NJwg4<=xee
zr=1n3o{>H+mjC|dS+|QRXVl`2-um>~RMm{irq+z8H)v|yxtDyu`Vd@I+1Kq@V}xVk
z5Y!9#L5uQGi-i4_lYwKbaa)S4dzvSjSjR)XvQ{KFL!rMVdT{KktYQ#s{|fpEhV7vY(f?e%2x
zIY=7=zX}M%xZ+mF`S81VE(9rnRpWEmtQ$9^c5X5{7*D6uW79|#vm=eRF$>S-(lavJ
zGqk)k3=A@R;U>?QwOqqdlf*kDKHkr-R6O1oh{cWaHW12I5i8s%IXrs+o5|S;7~hu$
zKex|LQ`P$yLf?J-m?Y;M3GwRA`q|6N%NZ@R{d8VgnR&eN9&>Z^yt+EwJl)S-UE;NY
zBjT>%z20avnzV~M)mI8>F1{Wf{X#@#G0(`}-oERqM7*)QqGCsPwn0@*&6UN)ke`km
z*+;nl=#lEIkwL_ak#fpOem9M_4ah4l_KC(|zAf<9SOQlbd-0XJKqNBkv`g9e+DHNn
zUj(=glwV-430qlea11J>A&fdNqbln97oxA(^99$)bqZ|Ym{Cs_%
zio&Avkg(Ba94i%2D&w)=nZkI#1U+?!javEo`JMYoRstx^6fAyym7bZ|k%PdUHH?Ue
zP`e7`4?}LJr3o1=zC$5zIRxEtbad>C6B50pIKLhxuOteE+KRzoDhUGqZHpq#>10j*g|>If(18($qT?HW-aD0DAQF1J0}5o>feMZmIlI_e6SJb@kDF
zSRC_eZ{4T?cJ3K#l#p9(<^VotWp-!)!I>g{pwX_x#X%hRTNjN7jkX}ZPLt7VaZIT^
zyM~4}S}vb{qm@6VtxxyvTyp{~HZK$pLwN6!LbW{?BeO$%>6s}E2T{;jTD0D9!$O(j
zTi@A-6-*pwHTuA|Q@BGxWUwNS9qZgZJ@>8#ttugh^nf-n`>DBW0ZWa~CkTy?b1oH#
z1i8Qy8n=$i@8G{*(KnqU9pK??4O&%p<$}||tYL2a`!Dk)-BHfpSjLMg4
zI~rC;TY`^JbRq^0XdFM@G?yLTZ+d>3wT!7Tzhv;TiA_JRMM|L(Xt5$sQ};M9B;_0sx@N
zUkIaKKW6x$BJj1LiH}dQm-GCqXWdP+!BIqZu28BqgB7+>R#q0+J-zSksEeK5{PH)^
znKwgHg#(FLP>U9%{z06Q|CM_EBLMT$@67Mwqxh)gON|#Fk3?F=e^IapBl8WLof?s-&2dr08Ns-L8dpJZLeRY&&do{yZd-mRFs=p36xZ@NHsCI>~$@
z%&>oS=`0VahueFzr)d^6m9A2Rk7O&nr0`E{`1F10TwI-cR);~hoD9)okiHpoxSeS6
zxqT5W4p3W_m^KylAlDO|RYqWZ5Uj^c&~0}R(!ZtTTMV;&`Gr9LMwf{ByF7IVA%07EX_VH=m$33OzwK
zHLi7JVlE_jRooe;q)Z&mVZ3>1acofIYX&9YPvRxF$|Ul}Mn+(C?P-0FAz{v%bH>n#
zbut$YykzeJWGHf@;^zN682^!4>yz_u0a~)a43xn@W5%hWYQhzLqbGq%WD}Otk=e$<
z6@rD1<&8D>!sx>NqXtafEr8!z$Iyl3$(J?iAf##2vclJ)AAb%iB!h8`!sx2g`ZX^y
zF9v^c?O&qF>3o`_1gQQY7(0BR-TZm_Bs9plA^f|T={qOI*Uo|nY)^p7pWUwte1Opn
zcw-i>yk-<(d?fB8j6MS1qIn}12;)J*?u1AzD?yjY#A12GQHXR3ZsBp;|K271ZLB}G
z5&u2_4Qb=g^WgeglEAVgu>H}k+L~XI!bQcg+1t<;mNm06Ki*p_iMGpn
zDO3#X!BeE!2=K~jm3>d`@L>zSBPjdm@V9=B_V)4b;~dj-Ps8=``x<21@4LNd+`Hq4
z^DyObQ=4ClqDDRhvhY^6MlOeddDm6Vb223n{;5-Bvh%1VDVIc+-6tO)N#)PaF`%t?
zTRs7wirbDl6BxH9`dx4=vTYxNECd8&-FK>VxajN4^^VIukUcR63=SIDIN}o2^a%36
zt(fA*vbo6(Mad
zD?WiDDEz@e{o(phMX;I9#QDzXXyd`&xu&sm2kd~;;bg2R=J(pxU4yQag7}y!{ynl3
z6IZu~`{0SyK?|Zwk%K%zMS88Hu@TvHrzMhCxel-l!l#bQmB>;VK;p}0_IcO8ZX5so
zdjH+VbKQeoKj2DWFLU3+=)@Px8(L}Z9qWeIFBVRNjCj!m>To~u%|-F%Bb;>0SMmU;
zhc3$rH=rwuvrxttcE)#y^zYEz&M*&$H$8hnosBJ=W_VnW@Z+gxE3|Q)o_b3}S`2(n
zePS!#y9*AEs0USM>+7leb`3q6C-mg)B!iFH*Af!FkPLtw!C_NsKVdJo;^pKRr*HR;Q3Wojbudwf&;q4d6y!YNkZ
zFWNdu-v)O-sOt2v3ITF_Ws7?#W04Ybk}-F)thCM>lt(nZyEWise#0f%!S2ST|0$i9
zDE$3ES@(X0mcTqdhN|vyxYn*Uk-9Ht1ZMb$csAmr^WbFAWW5#YUgOqf%Y+5g6YoVz
zzpKpP7$6MK)H^&nzR{Hs$w~&@4<`@XJd{MWJQh3|=-L&~7Z}1d?o!nMjz7n|IZ5ldC`CJ1EnxJ3O@;DP|;CwF1}T6>xOUR
z?0h5_L+a#IAW1G$xtgG2;StD{gq{fVet`_K9~l6cn-;|M!RW=xo>S1EMdix=2WRXA
zug8V>C4z>2S5Rss&asy3OIU
z&cYslX0?((x1;q8*^Z^WTc)$UZo}5!k5Ye0PpyYQX7NcwLxX$nhV3$7GyV6e>o3s%
zdo244pjrf2>nNN^&@{5l#+PiQ
zICcrP*YDrS3@5O2f@$7_$U>?p7bOu=ce`+Xy5)d$kucnN^Y9NU;mbBsdK%;)X0mk1
fOX}aIgb$@qwml
zg2M`mO22;zF8KKMiI%sn*10q1gExd4Tr__0Nawtd=E(pc$L!IgGahGs&TBLlba@MT
z2Z`p0PAL-lJSlkU4vS!;?k*soXQ##GE}`OJ#hj4PT|Ze@R=Q~Uo;iC~Jt#9OEifyu
zj?2$oLwm=sof&dM_|C
zQL*@@-<8){`yM~|@gt%uKR0(TQ-N{Rym|BL#MCst
z8XGT&ThH9!tVXxJrnO(^MVz0O`qVFVszo2r=M$H$+_P=XKNEh2g33zG{@VNLtf3L6>RyKpo_sCZ
zX>)Dj#qf|xDjbImE}v7Wxu3o*_jBqO^->$2!y7-eEUP+aHTT?&b6&n-d)3dZc-ehD
zB5wI-H;w+(FRko`#w?4y(}jxPvV_BnU!rR#~yg3J?CIDrAV*zPr7@w>Gj{&(!+
zd44x)y$i$X1@`SLc>@+RFEDfHgqBKX6ELFwY9pZ(>9-M
z5an5LG2_GM&&6ziUe>I>dg$s^(QVte8!vrcx#woirm0a(y>89&va$=WW;yaQ&ahz)
z(_&DtW=>0d`i=2(iCn}%hG(vbbc;1H*D<@jzqI+Gt>9Z=UT5%h^>bP0l+XkK3rg4I
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/isd/multiphase.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/isd/multiphase.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..82d9c12f6d4149b5d5e24fe644782b6d72fff941
GIT binary patch
literal 4032
zcmZ8j3p|r;|6eDbh`n+q=FDcAISs=~M1@ro6mvYM*WdTr#+&C
zW}T!QHbY3xnM2HB8`|-Hr}ue3&-?tZ&*#3c>;C<&>-v4K@9+D&KKGUV0X`~9dP*P=
zNM(<&*Fg|y-97p9&tEpkErVXW!$6?*sQrF{-mhQ3J{5H`Jn}?vND%JO!Cl^-Ufw$+
z&YU_Gc{1eK(a;kimX?->4hMR9d!pT3-8|3`2m}}o3EluY;s^pj3i91XO%EieRiGXj1YiMX_>1Zk_D5z_w=j7yQYimPH3{A{T%q&cy)=((i
z3JQn9Y+#z&8d|!V+B#Y`2peM)qix&tRa8_|RaK2mjCJ(1j~_oC1Az1}ps1)QJRWag
zWT303qpPQ73AIq$s-_B7F*G!Q+F02+B7=g0EUnCK?GXs%c5@3e9UX138dw#qs-~u9
zWMX9Z5CH8Z+aTbE5JM#;C3W?!nwlCg7!+;;w{<{R!(rMw+7M$yb4ybPM|%rPbBGZ{
zPfs^ePAtr7hbIQJ3xn}=N4cTgF>Vl3LnBioQww7&xWye1$j-smeTSR7hntg=6K01y
z+70cBcCp!RBX1EA5m3Zq00fdNA?EgHzeBM%Z{|m$HrWFpZ*T7{Ta?>DpnCw|`v;(`
zq)eeu^mO&*GuhLx0_3@0mwYe)2ih^&F9)#>b}sO6vR6dX$;9Zh$tDL>D?3M*{^egtM*86oc?hRXq%onrvu*P20A~2Qs
znw;YHsBs_Ea4*{BHpfWw6Ya@`D@7*SSJZ;9Wsm0Y)HxaSAHSW38a<<#fjpLo#l
z>vJmt2dYd{cn3nKxoPuXZz3p7>dZ>
z^4xoUp!Vkdc(daVBgYu-or=KS2tqpo?zebE5q!^{LkU;$B71J
zpO)&*+szIc#XU0($Hk`mN8fz@{(;lfkX76>Vs({`fCU+xsK0c$wEmNRrDw?5toNBG
zo;hj`m?TM;l5X;G{D<`@`!S*qy}2{BySnHan9w=*IE_;K>Gt~vJ*U&__J*9&u7-AW
z5bO37&0XyOO-oBO1&-&1o{S8SpP!DS+_!n@VXv;N?4vIq+VvSCnB?%Ki!t*Z?QT+C
z)^G8h+_XVrpWmp>Z(N1VcjB*KpHWa@(q8R6Ctc3ha(?L{txwK2N$OteQc-FzVr`8)
zSK_`{-1Ojhl5SaRtw#=vqn*6UOKhaWW#7asZkC&MHU0Ia_bWeKu5g!>x3&>+%!1xZ
zD1?AU6_3P-O7C@{h#XnI}fKm#gG?NpE`g?4$;v)^T3hJMTz!c27V&3
zhMrx{@ilHnTM5k7_^Mq@&hkuFj$)rrd&nE&fc!?j2FDB6+V;E
z`OTKn0>=2Q)uz^Sj=O)2&dMvH1b0r+MUFH&aK4X7TVPlvSbrs?e=8cEOHY8ksrB$?
zA&6~N-Gr>gxZ$r@#;&=u0D5G(^G+H@QnK2#Amu#qdVZ(3a=L!?ybqJK$j-(%VFY6>
z9z6CnDtdJZ>$dpm;M1l|m3J&yetmRSIkD_koM9M%br;PjVv=kL`jzWmTA6pA^y3xPq6HywW5-@inD{{6Y+D31_IoAgIoQwy~iQk&@)|`sk}>7osmN{
zHUxtvp8B4fVA${D0+}nLQvC0tEQ)aVJ47Of7O)t4UdihW+5C@dsoP&HW~Q!8+feRz
zG~mnJj}?=n6FxbE=gNw~D{N-7RtZYahY+?UuD7q!h18GTJb3TF(emqSU-wG&*3_Rz
zRa`m1R1}|{3a7MJYu~NQFnSVxVG^x3uh@_=s
za*3bCJKKkt>wePsPq$Dcv9?qA%h|8wdbjy8)4CCdtcU>q!0c+sxhI+_jEaPQ04D%92#Q(@q}i7YtBQ
z__P%HX6QMZ*-V|;45NIe<*`4cu~R&XDOv4VntA@b@hZNw@6}}SDqg9ik6Jx)P~aAe
z`Pf6NLN}83vH6ds_X^?OFX|K5zFkhWr2dK=zXK#D4jPH7PH|AMsqZrANKRWJz@7s4t^r}^}75_w&6W*DB3JWP~o)wS%RR;nbi5naoIlSck`T9Ise^NSkeO-)`yL;n@Iaw
zbVWXKRO~Q@QfOwM?@osEY6Jw=JQ=o`4~~IH-kKiy*9ke5%EC)>UbK1sl?g*+&
zwGVE<+Ryc0&G#b_c<}qwf*BVR7u6aJp;NI<3)UjFPrqNAx8ROw2qe_^(n=~k%{NQ1
z5)dG~DngvM*WgJEC^B4n&Rl#!reM(l4ds^=uM+aoWmo-yXv-gA7Go%jHE45(Ct{nd
ztl13cs1W^}i}6m?>6ZB);-576P)o+KCC(=Y7*(f962tG;ZWND9c27hNX#RywKDvHj
zNm`K4V)c;iVE2K8>2enGdDHP-lCZW+MQMSb6w<7eGJBH|dy6o{xI&;Mcdy_-*pmBT
zBPl?{Hh!E4E7#Gp)jE#O+UjA-6BZO@4o)mk<4iOXL+
z$Su!~l@Z;pCf<88{I8v)+&G~5e+^BwMG=2le$~mA_?CwO%`bkgiMh9Cm?k-u1{@$9
zFwBRAZ~6Z!lb60crVA&QWFMwqeG4ZG68#bfL?G&9l*F8sTA|p5v+#(&>bN&FCsF<~{a#M)w-QEW`u1+y_7os$kgp=OTvNTu+SN1>1ygJ;O)3|mKC{x+
zD#8i!x473SJ*<&0%qnsX)h^tN_p2mqnV**G$avL2zlj4Ped;|;!Ug;dfvk}OL&kB<
z5g9EFWOc?rWO*?;wQ5iKjVr=dlYaAuQwwtsOBiKUFVEDa&52P<%GK5Cn9kkF-4oU#
z4EmuA>mpRFIglY^PEUYSb?RjPaXc`-<>fNr`wfWmRN*oq<|d^7U7~Hcw5WCR@5OpX
zPJKBO7Zxkt=Ag{L+U&
zpoyHjK;eg}h4-APeljdye%B)9-ZoYZ5NIg(otrH9m;zLk2rCkY$W;-fDtR_z?yRNe
bUVsdI^k84xOaO?x#@HV30I#Q>$1nUFD4*Yh
literal 0
HcmV?d00001
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/isd/sidearm.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/isd/sidearm.dmi
index 60d35a43f8a3e0f8588740082906b23caac1a583..82d5185888eee65bd9e8887d1bd31b94254156cb 100644
GIT binary patch
literal 9167
zcmchd2|Sc*!~X{f5m5(4rpR(+jqF<`vbU*ZC#0;|4Th))IgxejLSzYLXDpR8#+sxt
z#y#RluaP8Ed3I`3j#R-
z(a}729lSy;&Xot>AhhK0a+=}PRSLUbXeMG_S6HL_n0E+-e_`T${jyES(JHA(2*=1#
z=o@o}=|>x`+_gjIZ{KLVj^Nff|6=xO=(o{>fzK7}Z5&(?PX)pk9eZpI*kPBV3z||J
ze$&dk^ECU@(Z&lT5`^Zsb_$`MkmIND@{acB$p6%lT4;s%Il}1mHBT`zCxu`7E#bh%Z2#-d{?|9t?A0y$WVQR=
z=BcNLPaAi?3C3n`Pv^v}lgBAO#DQo&_04I4{M*IZw~Je1I4W(W^LxhKiTUc=?T$aD
ztIQgylAgFk)r7aUjW5b0Nd~Rj$ZZM{
z>AEpprA{Sv9fWSLZ!C{L>&P0PX`(H;F1pcP=|godE-A6`^7>^;of`3k4N40MBA14G
zL7{2^;a3axt!7Z)TT)iI#KgodF*7sACNd|r-e_&RO?6$qmgRFgsDo;WOu4sl3l&rM
z&VxFMln?j;qbwLD@ThI7QrX}ep#x7|-VFaT?RsHrsg>cYbQQwnR
z@k>Z*7d8Ib3f~fZYq0Ch@^}m+7$NWKe;d3J*x7E^mNZouCv`an?nFfm4O8V*RH8;l
zt)tS_qI>%CeW=)N{LL83<5}ePLC9r^L}iP{xH9S}Id`gI#1KalnNIB`F$N)5j5Cbh
z;zE3ypg|j19_#ZaMa9K5-y|;U`1fSc(a{;O9p&TO4@sI@hqY$FDT;)L5!3NEiLAbG
z66?W(G?0YE#N5eAJ0@Ru;@1423^@5g2)AnBv4(~Q7$4D=#6dFZlNC-gtO{t$FwEcj
zP6}X`HQ>4DgGE0e=3}9vz6HT^@r3cV7~&E9%1Zg26e0b-_xKFB#P$LK-j<&cB)a>H
za7I8me!0&`9lKh#kSfN0T#OwTRHv6<*CuOF?=^P=rSA0tZC^E9>-BnZIrOtEdIjnI
zwRn?^XC2y>HaJ`^R;BWKQk{uN!e{8YWXY|5S`nOOF&_|wR3DExaYc-;ChV+%2ge6~
z7j6DJB-f7>touhAH(`!u*T{=FU0*7tdJFrsmVSPCo8yX4ub27lvrz(xZq7ABNofm(
z2qE(U`Om63t?;ufINfS*_>F@(#VhozHFVy%Ey3&&gk}3e!a06E4=2pWJZE|HmXt!J
z2pe`wP5y6h7gQySeV!ekR>!^wZ+rZ4>np0#ImZdJ(IReby!JATNQiO9I3v%1yOaoS
zG#YK-x97$Y6tJtWDu_0bx>w`GNVDxXivi>PwJo_|gM{4XY+S=1sWDUZn{
zfv!w)Yt<=s3Difs6#Eb6MB{!U`E|h;aVMvwSTR({H?Ar84{~4)-B&Mj
z+F;CcMvf0-&o6Y#qIHf$f_HVEV$qHAX*dI
z=B)|4kDB~A@6;_H!1iyGSio&^&i~@7WIRlZAxMOKqd%GH6&0Uy{{6PeB{zsi!IZw^W@E&Wy*-J2J!d>F%(de=j(D#o-g|a5Nf_Zj
zb@PEKq{Z!!1o!^V$yIPGtSMgW3>u~K4g~QjoEhb+MB?i9`@fY;VIp+Pz`!Uvoh3$P
z5y~B0R{2<8sBhiB)(d_Q+~CjEFnMBcjgjHUR5yh%pfnXsq1B>2v8Xg1D6RWb1pECr
zuF7zfXur8nMXet^iP}u^nMeq7aWPaX3a~Tb`+Voj)n=*MLNnI#x7BZ#bL`T7<=zkE
zcM7$FS>P>25Zlny%t$uK`K(b3lxUU}w>f;7rm1)A>degH(`HgEw{9?HbuZ2BKJ*C*
znhMum1e~9?3kkZ02%lE4{l8Y|ZHW<2CGp%oM_?if6NM*!G3ZP6R9bkuNm|^jR}n@!
zrhLUM)*?QTL!Xe4Bj+fAY2Vrsm=zG{8`laysd|r
zE^);z)0K6GCgqv94+I)JJ7du{l;&14af;e+^(u{A)p(4hU$rsuwx|_2<=Ps*gqFZ>
zr!)rEG#cWw=4$srxN_KwO1WZq&o6A6DI+BPV0r1xbWIFg{Jz)4Hoe);P@8NhzR#)c
zt_17pmH31eXl($!FtVX)3l{W3vim&E{gkOwPcaDOJ?>|9-!gmlP+}SO&eBZY-hr;B
zGIYAuLX;TAO1>-=P{(+m_=Lp3yb5ndQ(p<1nKq_Qt$bJyR=iYRmFxYAEyY6cP^a
zrYGT0c=r_y>7O+P`S|^q*z4=Sjm%DMTT?o4Xk?G6
z(9>)MFwm>(qScB6$!li=8F&vIB;LNkMBh4Hh-L_`sZlKG`M}^w+?+MJZ6>N3X!D5q
zF%3%e?$!!?t0
z)5x!by6#=9*cx%9LFAcG5*^20Hy^s5AsOW)SGU%0#hB-KK4DTLAWLXWngMdh#JeLc
z@b0@4Lu>uYL6@be4J5X_s|ypB$Mtj9q3XZcjh`{77%SN-oP|;Po39_>;mJFNdT?Sr
zH=f)O#5@*7H}a*5C>20@>dKXs=h)djd0K(Apb7~tnTv&b+@4JD`Y9;^%do8hhJDBY
zA1QdfLIy+6T~m^JxRwvxRhX(#T=7f_5&%E>w7axq<3`K7Edd=cK#2e8cXCwJ+}y!c
z;*a-U<~R``FlzshxW12W)AhWL+0x
zk-_!FL93MG2|x!$`8nti=$EZ#rSL9Q!^NkiD5;
z3Dm~zGH25Ry_hq_69mW1)zdWw5QmWw{bs2p1GSiIq|)d5LRliZrYA+7j&+=hQ;4S?
z1IF&1k9vq$E-60sQv%z0~hc)?Ush+lbuLy%w<{RtL^Q9xWXwU|DfUlKfRo2GjX
zJqUX}NX`Yx4aKDY@0io0|FeH&p3sZ&{}U;vT+A(1JE)Jolc^2YTb}q38a)?LadDl(
zqf#H+J}x=EeprLRRy6wO<>j9j5Y{ScZd@Rjn%uy8$-hPr^RG}E8(sn#{+qoNMy*^H
zihF+GagQ+<6w-l4>pY2f1?uOUqCP}W&rLEzpij;>42UuBsQQ88r$1n5Rv{L^d!S*s
za~Yua*dzgST#B9jEa$ZRT15CWng4ZT`Y*zsXreXD@4Kp$=B?y+W}#QM*s@PH|1f@G
zF(%J($CLu`T2Z2fpb`A2I-Jm=1T;FXB!xWBtl`Y++1L?9uC^HMow$QttM51>~{O#jkPFh1Y
zDCdtLB}%q9&o59eab(WBO-Q
z(Sw7Tt{Z%{CBN(Fr#OB2z(7UE9*+l=F+}fqQ4)XA_Soz?dAoWKdwTLy$b7JBc|De}
zY;Gs-2uqp}6=(p7IP@#VjifUMp7d=23M+;?7EvWLeD2NlT3|L45%*W8XM=m6m
z^7^ya&cO~v@I{iLTG@>ggheCyNt`~@{ghgBi8c|cCD(u|8YrOt6Wr&*PKL6NRanCg
zC}ecyT$ak5s|6v=`$C#!JN>2sxQ-#tU@6`(=Eor(Bo#wA@$By$WBU$;Gz_OUQ~}o*
zTQUcnnHwdD54eCQ$;rv8T*kmL-m1b=PaJa=r9R=}Zxf{wBsEpga4IDey`v%q$gT8L
zPc^0|(rR*#9ZY}ez^2aqbdZm<45My^2JWOTH+1>ZD7H?#v;aZ;6Y1cR@w1B;_9i;*
zDw_+X4n+HZ%=AsbuiOv0y?w$r0Dr6PO*Ryc`0qh$MA>n#j9Fmi*~6(}7Q-Vca~O#a9&u
zj%|#b--m=uE6z4nc7K9OxyvZxvxnQp6jB?IA
zmCl6WD;=d1LA2e39@3T_w=!M?^#C{Kkl`Hf%wt*26<+A?9dha)=v%VY$`K>CkP$v&
z0Amir>EF_Rt#MTbBk=B{BGwzeDQcS}qmWv*_awey88e)GwI_zbao7^kAcoySNuSwp>ZZTEL$W!fW519
zLXIXiBvi(t>#h)UX@6%uoa#FXr#4baFvXl?vHCobr!q2sigOO@wa|)dEg@%-v9D|K
z8y_`}x^WT8Tj(!OLzOyr5d=^j)??W3qO~Vl739}D4*Z_Bn!KV6g9!YGmsJ&CoRm&Y8~Lj
z(p4#%ROhF%l98T1%apxyuHEc+D{
zE@ozhYJoOuoGf$+#^*(314d$oEAKhF7yS4U@k>eavVTQJ9UinV;Yz~Ou7!u$kDLA{
zD&GI1eEYrmTKpk^qGp-&cVVkv3k>&qRxPkX=%C;xJ|1ITk{VU~*maX%nPaDW*C
zZatI6T5%PwBq+sVdd)vU48;n0p=(#awvO45Z5Y8^{6t2ylDE_Rcvsaur9m46S~-yK
zE^&0Xqf670!`n_l8rAw>nZoQbstm!AJ&bDAhnjP2%J4w;MC%*e!OC3%%3S4~*P66lZLRxSJ^?<||5MvDz-`Z+v-HDy{B>B{$rm&k@hIW>f6+ZdX
zDzW_884uyGrWDI|W2{GjZ6=GtwD`{^L2!7`K
zPtzw>YA*#RNKr>R=fhf8N@0IWWZ$%Qo*o&g*Pm}xH2l!Isa%)w(PPAB4>AX|j=SmX
zzI{C~b4f^_B)FS{cZ)Sie$Do-rshOLCbGal)6?ny9&GP6BU19#=w6xCdNLIj>hh)c
z>GjUM-ItkywoiNX=+QG3$CrIGY7o;wCr+@l&{)#Nwn*BFj|TlDygeEzTBLso8g#1sgIjAJH_#o$rJEO|c3N;{$Zz3o0p<>M_qtrA;#+QR
zpL~^~J_yPX5bidWT8$-{k(oEghK%g+ai9Tuqg)c%qqPHP{yz}nRs2hWiw4@XUz1`-HBI%$m?ph*`9*&6*g
zKX2sFmA*inqwVnu%o&nVBHwIXTHrsj1OCp_u}DH%--De%_H(+6IDhw5FW*%Gh-3wr
zNuCI+zDjFMAGGjedlM
zH+9)xOUA^v*n4VwtL-#(i@4o|Lmfrm89iI&VW>*pZ0a2R)!Il0bRr9(Ac_6SE?Sug
z4mBX|lfDK%I5QR2dNL{|dUWsxy@xzrY30o2D@PmvqT+Sw!JjgHuGjjmT@Y>+n52X(
zIQ=c!_ClIln{r#6>Fgh-@=Xy3s2K+^iWVZWL-$PtkFey}@|^rVjk!BXsO@eCkbBB^
zkghKz&|V(U^5iIw`t7gDDMwwaJXChzS!oa8x#wG7=cLj3dNSy1YHGKsGim?aZ~PyH
z(e4iB-;cPGV#xqP7)NknVPPz^Z9ujdsxjG{tG9IjG0I#|4&lYg$*HvRQqU$ZF$qpY
z|KM14eU{Il_ujS(YY9q_z4(Y;L9}?+R*8rh&oYGj-sD7jBj6<&GU76CM8HH6zK}8#c3lV$qLQSmTQ~
z{{$koW^r5`+oE;96z`74A@`V(*JM;Hh2hBbu=}gTIh|XYobR~E;1XjvhBJ^*!J!DT
zdWjJWVp6%7UL-2RSPvm*7+AHdKu*xZ{@&%M9KCGZA9qN0hh~ID>pe{p^_sL~z#anY
zL#n~GDME7x!}IB~&s6JEpegzZDT@`^Zc@CN7oM5kmE{EuLjx!nYXbQ4p+V6<=@SW>
z$K6`d7smqn{2Porj#5S^)qmscZk5k6ud=n~@4i^v=}DA(m4rmfBvaE(+W6tWCZhZT
zJ5=-X^Zi?dwbI$v4>sL0Z9R+HX(IgnPph9*{pFaVw2j|cTfYarq*J^fH@6N6B&3i`2^nY;r?K0Z|OMWnCtm
zMV)V!Qu02zL#__>Y8mAalKj-xPR-EI^#jxl4$;>_AP`!_&SwF_pNao%P_nj#fJ0nc#l*S$S0
zW5}iVw*8%H-+T5V6Zi*9-qq^DdtE$%hOhPeijwkXI^D=gqlJm|>|V%P&}*l7_yrzk
z%f7PPFc|Uk#X&aw^YI}d3PCk((j`wf!cCuF$~_-0J(Xz^umcAheVk9mH51wjlsHUFBAbn{9Z-y#-pu&
zE~vwhiQy|*w`6uVx-^}0-2(!Vi~o{Poa)nT->WwNVwLjk%THu43Qs;zgfy*8yj;~$
zi28jOXlkg;w?8HNG}cF~1t&yXJss0@xES->P)K6bC|NsBMz`*`MzexZ900DGTPE!Ct=GbNc
z005tQR9JLGWpiV4X>fFDZ*Bkpc${^R!3x4K5Jb<(SA_PeqQ0AMLbMvcVWq;9u1UUefY5PHEUI|V#LV1Q`4*xdS
zrtO>eGoI|vPcpz8cNqWx0Ov_WK~!jg?bnG4!Y~X5;MCfxsn%=re*fn*O7LO_o2`ic
z-w&hElC+FLM+5-B#+dtfFi2e53VD)7#+4n0ny&Sob4DKC)94yM_P+8A6HP}PLNFp2
z(%4`tS57rz)>8Coo;mV-LFO*l>JB}zV_r%FYh%2;jnz7sruCC)^9f$(*%d{}%nv89
zwk*?ZUh8k9981+`Vj;OSNM4^vHhoLF`VS2<;Ua&7P1XkT6=W?B0001AXsfBS)705(
zdM`L=`fiYp8ga@o|50r_cy}HE0001>QT7XE{mnm-`hOPy0DymX2D{A*NwHv5-v9sr
M07*qoM6N<$g4G%F4FCWD
diff --git a/icons/obj/multiphase.dmi b/icons/obj/multiphase.dmi
deleted file mode 100644
index 493b8fba1202c7462efa816b3f7d5ef37bd07fab..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 2441
zcmXw)2{hYT7r_4&BSuGJi&zs&V~K>whC~+IpkqlZq^MX5v`Yk6sBq;cxhnKsjms{M4*w~{n
z;gMm7zYVvxwhlhT_VjY6x>8)}R3s9qmk0MwM;ioXKxD-;;|*P(|)Qak}p
zScsR87s;7`vA5$`nk)JN9st-JPYMoW`}zC%e&g%w=RNx5ElC^_E}ll+S%G-Y-};MXe=5A*V8wI!434W4p?&wGZPbI
zO-)S*1Y&MsZeRqDj*d=H07eWTK0ZDwD$3N%)X>Pl&`96f)=FDP8v@ltAWUtsHh7X_
zNJxma4GKqaaB#FoS?x10fJ3#R5GX`jTieXS3}3GR_Vcg~7z7fbp`oFxs{@1Sq0zP&
zECxq(u*0C?25_V~0%dJUBoVBvQAjhSk&)q1WmeHPOm_yugTZj8Ik`H~7_LZ5gqfw8
zrIoo2#;Ozm@I)Mq=}M!!lF4KSlSXx=Qm8Iid#tjhbNmw(if}4PSpacyakdT(3T1il
z`NW{#h{{XdlX@^92w*O}Q62+KWwH;Ydd8iKNjaXJdOYbQ0A!TS-=yt*jMKWbILEn|
z4qMK9`nSCHbaHK)yY~1=(e?THuKLjL>z0BcA*ZqL
zng%F$=W23;x_ou_-~20nzNVM5cF*BLw$2@}=w-=|BYb0**F5bH2QLz3kbsb7yUBvy
z<;d^ta$BR~yQ`~^WR&4a4!QY+eYe+Op=G~{s8`=G3bQx*CKh0|0nBX`zt)cJ*Y1*ynVh`NdXe+u&Z`K2w;rjQIHZHsQD>9T32Q=6Ng~9cB!8)@41Rm^
zUTS&`^~UntyNG3pw7fR(cku~Il$EBdxE*Y+o?~{|F<;+drWF&>>UyKJKOe^Z;^4mO
zL&coNu!vIABSoacA3u%k@3n$(T6Tk`rcooTUA;>Rj^9a%XV4S$Iq1
z{Sfuh!no+~)z0z>t?%xBGb79x8F&~=b22??YS{Um@crDiVd`f8m#JWcKOWwrU|q~IHUh2U=4=XYY>
zs*E6VIX)xXlrRo}dgkUnDxUJ(&zM|lSj;g~7J_=toJO!bx;~Gno^+;(XsIa2M*j5M
z-CtSQM(ooc29R}An6~OeU$(_6$U!YXE(!})lUg$(+^bm+M#-;Zo-RO(-J3(3MNK-X
z&*c$B=H-q(E(hd%|Lg&z#qC6<03`)gy+Hbzh2hE9(x)Ro0ik~0_i-NPD)E=D>oYR*EE!Rk%d#=
zYMPqthU)PT(U#h-8AOTP8)=erjp
zytP!_v{Xa+a}x@&1@ahLcIKBiQ7fF4|43(3+m~)0c{&dosF|pE*zhw)a+5-^`j>UK
z?YlAZXbfrrgjNO+9dO(5M&0RNpR}-?K~geh9#sE7NwAW9Fsj0*99nlx$k~<%GBdaq
z=17)lH>1O2O;}ss-e|Y*uOhcT^G}r$=-mDa^F&_v*mm~H)=tC5o{yisL#5KrK`^^d
z9Df_CKE`-4F6_%PTa+^vK##_>ck$iyaV`=?`wK98Oj5M9QN%;8Rlh2AypkDTz=jVY
zmu5fHb$Il3@sm#WfAFWu8I^5afxj~t?cMw1dwqtWtmWFb+n`Hhk^@T2wvU@!wvzp1
z78kjD55`eK?|Gqzs8lK~f%aejqq`!Ve!X30c8bS%pJkS`?Y1DNFMyN~j>u=7*Zz4Y
z_^4ZYiIo)R{KdA6orSddYTB!wPHc_7~S=eAc>yxwYEM2cxY$uN`?)Ot9646jU-OBqEpI@9bF^W(IDYKQoEsx14X%
zexyjMsTE{1YCb5ge$q4IOF^lNLXR5{rJ!R^w#Ak)DZI#Vuyv9IEXb7zt4_0KheRvW
p(>r@U$bn0mN-5~}){2dkf#;0!?Tcqp?km4cz}G9lv(Y^|=l{HjS8V_Q
From 84ba8c91349069e815cd983337d5c701beee420a Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sat, 17 Aug 2024 17:19:23 -0400
Subject: [PATCH 24/68] that
---
.../structures/crates_lockers/closets/secure/security.dm | 2 +-
code/modules/projectiles/guns/energy/nuclear.dm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
index 5c36bfe161cb..8c60d2e50d00 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
@@ -120,7 +120,7 @@
/obj/item/tool/crowbar/red,
/obj/item/flash,
/obj/item/melee/baton/loaded,
- /obj/item/gun/energy/gun/multiphase,
+ /obj/item/gun/energy/nt_isd/multiphase,
/obj/item/melee/telebaton,
/obj/item/storage/box/survival_knife,
/obj/item/gps/security/hos,
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index a4b7664d8527..2cc2eb61136c 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -93,7 +93,7 @@
list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="nucgunkill", charge_cost = 480),
)
-/obj/item/gun/energy/gun/multiphase
+/obj/item/gun/energy/nt_isd/multiphase
name = "\improper X-01 MultiPhase Energy Gun"
desc = "This is an expensive, modern recreation of an antique laser gun. This gun has several unique firemodes, but lacks the ability to recharge over time."
icon = 'icons/obj/multiphase.dmi'
From 83556ea5ab60d09fcfb922dc26f9f7bcee169f35 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sat, 17 Aug 2024 17:22:43 -0400
Subject: [PATCH 25/68] out with thee
---
.../projectiles/guns/energy/nuclear.dm | 24 -------------------
1 file changed, 24 deletions(-)
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index 2cc2eb61136c..921c0f7b64bc 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -93,30 +93,6 @@
list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="nucgunkill", charge_cost = 480),
)
-/obj/item/gun/energy/nt_isd/multiphase
- name = "\improper X-01 MultiPhase Energy Gun"
- desc = "This is an expensive, modern recreation of an antique laser gun. This gun has several unique firemodes, but lacks the ability to recharge over time."
- icon = 'icons/obj/multiphase.dmi'
- item_icons = list(
- SLOT_ID_LEFT_HAND = 'icons/mob/inhands/guns_left.dmi',
- SLOT_ID_RIGHT_HAND = 'icons/mob/inhands/guns_right.dmi',
- )
- icon_state = "multiphasedis100"
- projectile_type = /obj/projectile/beam/stun/disabler
- origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 3, TECH_POWER = 3)
- slot_flags = SLOT_BELT|SLOT_HOLSTER
- damage_force = 10 //for the HOS to lay down a good beating in desperate situations. Holdover from TG.
- w_class = WEIGHT_CLASS_NORMAL
- fire_delay = 6 //standard rate
- battery_lock = 0
- modifystate = null
-
- firemodes = list(
- list(mode_name="disable", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,0,0), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/stun/disabler, modifystate="multiphasedis", charge_cost = 100),
- list(mode_name="stun", burst=1, projectile_type=/obj/projectile/energy/electrode/goldenbolt, modifystate="multiphasestun", charge_cost = 480),
- list(mode_name="lethal", burst=1, projectile_type=/obj/projectile/beam, modifystate="multiphasekill", charge_cost = 240),
- )
-
//NT SpecOps Laser Pistol
/obj/item/gun/energy/gun/combat
name = "NT-ES-2 energy pistol"
From a15b3694d6711a8e66595dfc294ad1c02ab193af Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sat, 17 Aug 2024 17:35:59 -0400
Subject: [PATCH 26/68] here we go again
---
citadel.dme | 1 +
.../datums/status_effects/basic/taser_stun.dm | 12 +++++++
.../nanotrasen/items/guns/nt_isd.dm | 33 ++++++++++++++++---
code/modules/projectiles/gun.dm | 3 ++
4 files changed, 45 insertions(+), 4 deletions(-)
create mode 100644 code/datums/status_effects/basic/taser_stun.dm
diff --git a/citadel.dme b/citadel.dme
index 01a5cd49b911..836dff51b8e0 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -901,6 +901,7 @@
#include "code\datums\status_effects\basic\crusher_track.dm"
#include "code\datums\status_effects\basic\incapacitation.dm"
#include "code\datums\status_effects\basic\sight.dm"
+#include "code\datums\status_effects\basic\taser_stun.dm"
#include "code\datums\status_effects\grouped\crusher_mark.dm"
#include "code\datums\status_effects\grouped\staggered.dm"
#include "code\datums\underwear\bottom.dm"
diff --git a/code/datums/status_effects/basic/taser_stun.dm b/code/datums/status_effects/basic/taser_stun.dm
new file mode 100644
index 000000000000..810817583791
--- /dev/null
+++ b/code/datums/status_effects/basic/taser_stun.dm
@@ -0,0 +1,12 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 silicons *//
+
+/datum/status_effect/taser_stun
+ identifier = "taser_stun"
+
+ /// pain to inflict per decisecond
+ ///
+ /// * given this usually lasts 5 seconds, 0.75 is around 37.5, which is pretty reasonable for something not meant to be a magdump stun
+ var/pain_per_ds = 0.75
+
+#warn impl - movespeed modifier, pain damage
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index 3c9fa1ab7281..909dfe63eb2d 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -13,62 +13,87 @@
*/
/obj/item/gun/energy/nt_isd
-#warn impl all
-
//* Energy Sidearm *//
/datum/firemode/energy/nt_isd/sidearm
/datum/firemode/energy/nt_isd/sidearm/stun
+ name = "disrupt"
+ render_color = "#ffff00"
/datum/firemode/energy/nt_isd/sidearm/disable
+ name = "disable"
+ render_color = "#77ffff"
/datum/firemode/energy/nt_isd/sidearm/lethal
+ name = "kill"
+ render_color = "#ff0000"
/obj/item/gun/energy/nt_isd/sidearm
name = "hybrid taser"
desc = "A versatile energy sidearm used by corporate security."
description_fluff = {""}
+#warn impl
+
//* Energy Carbine *//
/datum/firemode/energy/nt_isd/carbine
/datum/firemode/energy/nt_isd/carbine/disable
+ name = "disable"
+ render_color = "#77ffff"
/datum/firemode/energy/nt_isd/carbine/shock
+ name = "shock"
+ render_color = "#ffff00"
/datum/firemode/energy/nt_isd/carbine/kill
+ name = "kill"
+ render_color = "#ff0000"
/obj/item/gun/energy/nt_isd/carbine
name = "energy carbine"
desc = "A versatile energy carbine used by corporate security."
description_fluff = {""}
+#warn impl
+
//* Energy Lance *//
/datum/firemode/energy/nt_isd/lance
/datum/firemode/energy/nt_isd/lance/kill
+ name = "kill"
+ render_color = "#00ff00"
/obj/item/gun/energy/nt_isd/lance
name = "energy lance"
desc = "A particle rifle used by corporate security. Shoots focused particle beams."
description_fluff = {""}
+#warn impl
+
//* Multiphase Sidearm *//
/datum/firemode/energy/nt_isd/multiphase
/datum/firemode/energy/nt_isd/multiphase/disable
+ name = "disable"
+ render_color = "#77ffff"
/datum/firemode/energy/nt_isd/multiphase/kill
+ name = "kill"
+ render_color = "#ff0000"
// todo: this is an ion beam, not an EMP pulse
/datum/firemode/energy/nt_isd/multiphase/ion
+ name = "ion"
+ render_color = "#456aaa"
/obj/item/gun/energy/nt_isd/multiphase
-
name = "multiphase sidearm"
- desc = "A rare sidearm as versatile as it is expensive."
+ desc = "A sidearm as versatile as it is expensive."
description_fluff = {""}
+
+#warn impl
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 76512e496447..4380ffb5f73e 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -11,6 +11,9 @@
/// state key for rendering, if any
var/render_key
+ /// firemode color, used if we're doing colored `-firemode` sprite or colored `-ammo` sprite
+ var/render_color
+ #warn impl
/datum/firemode/New(obj/item/gun/gun, list/properties = null)
..()
From d93cda1882020a88b090641d039ffaf042159661 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sat, 17 Aug 2024 17:39:39 -0400
Subject: [PATCH 27/68] stub projectiles
---
.../nanotrasen/items/guns/nt_isd.dm | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index 909dfe63eb2d..895b937655e0 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -97,3 +97,31 @@
description_fluff = {""}
#warn impl
+
+//* Projectiles *//
+
+/obj/projectile/nt_isd
+
+/obj/projectile/nt_isd/laser/sidearm
+ name = "phaser blast"
+
+/obj/projectile/nt_isd/laser
+ name = "laser"
+
+/obj/projectile/nt_isd/laser/multiphase
+
+/obj/projectile/nt_isd/laser/lance
+ name = "particle beam"
+
+/obj/projectile/nt_isd/shock
+ name = "energy beam"
+
+/obj/projectile/nt_isd/electrode
+ name = "stun bolt"
+
+// todo: this shouldn't be an emp, this should be like synthetik's
+/obj/projectile/nt_isd/ion
+ name = "ion bolt"
+
+
+#warn impl all + sprites
From 9dc6ea9570e3714aef51fb26a90ca28260f95c09 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 9 Sep 2024 19:30:22 +0000
Subject: [PATCH 28/68] fix
---
citadel.dme | 16 +---------------
.../nanotrasen/items/guns/nt_protomag.dm | 4 ++--
code/game/machinery/turrets/turret_frame.dm | 4 ++--
code/modules/projectiles/gun-firing.dm | 2 +-
code/modules/projectiles/guns/energy/frontier.dm | 4 ++--
.../guns/energy/special/hardlight_bow.dm | 2 +-
6 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/citadel.dme b/citadel.dme
index ca95287eb91c..0ef1aa6dc1cf 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -295,6 +295,7 @@
#include "code\__DEFINES\procs\saycode.dm"
#include "code\__DEFINES\procs\update_icon.dm"
#include "code\__DEFINES\projectiles\ammo_casing.dm"
+#include "code\__DEFINES\projectiles\ammo_magazine.dm"
#include "code\__DEFINES\projectiles\gun_components.dm"
#include "code\__DEFINES\projectiles\guns.dm"
#include "code\__DEFINES\projectiles\guns_legacy.dm"
@@ -4495,21 +4496,6 @@
#include "code\modules\projectiles\guns\magnetic\bore.dm"
#include "code\modules\projectiles\guns\magnetic\magnetic_construction.dm"
#include "code\modules\projectiles\guns\magnetic\magnetic_railgun.dm"
-#include "code\modules\projectiles\guns\projectile\automatic.dm"
-#include "code\modules\projectiles\guns\projectile\boltaction.dm"
-#include "code\modules\projectiles\guns\projectile\bow.dm"
-#include "code\modules\projectiles\guns\projectile\caseless.dm"
-#include "code\modules\projectiles\guns\projectile\contender.dm"
-#include "code\modules\projectiles\guns\projectile\dartgun.dm"
-#include "code\modules\projectiles\guns\projectile\musket.dm"
-#include "code\modules\projectiles\guns\projectile\pistol.dm"
-#include "code\modules\projectiles\guns\projectile\revolver.dm"
-#include "code\modules\projectiles\guns\projectile\rocket.dm"
-#include "code\modules\projectiles\guns\projectile\semiauto.dm"
-#include "code\modules\projectiles\guns\projectile\shotgun.dm"
-#include "code\modules\projectiles\guns\projectile\sniper.dm"
-#include "code\modules\projectiles\guns\projectile\caseless\pellet.dm"
-#include "code\modules\projectiles\guns\projectile\sniper\collapsible_sniper.dm"
#include "code\modules\projectiles\projectile\arc.dm"
#include "code\modules\projectiles\projectile\helpers.dm"
#include "code\modules\projectiles\projectile\projectile-hitscan_visuals.dm"
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
index ff6be490a04f..e314cac78568 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
@@ -36,7 +36,7 @@
//* Caliber *//
// todo: proper diameter/length def
-/datum/caliber/nt_protomag
+/datum/ammo_caliber/nt_protomag
caliber = "nt-protomag"
//* -- Ammo & Projectiles -- *//
@@ -46,7 +46,7 @@
/obj/item/ammo_casing/nt_protomag
name = "protomag casing"
desc = "An obnoxiously long casing for some kind of rifle."
- caliber = /datum/caliber/nt_protomag
+ caliber = /datum/ammo_caliber/nt_protomag
/obj/projectile/bullet/nt_protomag
#warn impl all
diff --git a/code/game/machinery/turrets/turret_frame.dm b/code/game/machinery/turrets/turret_frame.dm
index 8a3c97076fcb..c09956b3b2fb 100644
--- a/code/game/machinery/turrets/turret_frame.dm
+++ b/code/game/machinery/turrets/turret_frame.dm
@@ -81,7 +81,7 @@
return
var/obj/item/gun/energy/E = I //typecasts the item to an energy gun
installation = I.type //installation becomes I.type
- gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge
+ gun_charge = E.obj_cell_slot.cell.charge //the gun's charge is stored in gun_charge
to_chat(user, "You add [I] to the turret.")
target_type = /obj/machinery/porta_turret
@@ -181,7 +181,7 @@
build_step = 3
var/obj/item/gun/energy/Gun = new installation(loc)
- Gun.power_supply.charge = gun_charge
+ Gun.obj_cell_slot.cell.charge = gun_charge
Gun.update_icon()
installation = null
gun_charge = 0
diff --git a/code/modules/projectiles/gun-firing.dm b/code/modules/projectiles/gun-firing.dm
index 8bb283c732cb..0dfe01ad5607 100644
--- a/code/modules/projectiles/gun-firing.dm
+++ b/code/modules/projectiles/gun-firing.dm
@@ -16,7 +16,7 @@
* * target - (optional) what we're firing at
* * actor - (optional) the person who initiated the firing
*/
-/obj/item/gun/proc/firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/evetn_args/actor/actor)
+/obj/item/gun/proc/firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
SHOULD_NOT_OVERRIDE(TRUE)
#warn start_firing_cycle, end_firing_cycle
diff --git a/code/modules/projectiles/guns/energy/frontier.dm b/code/modules/projectiles/guns/energy/frontier.dm
index ded27a270018..c0e2c28604a0 100644
--- a/code/modules/projectiles/guns/energy/frontier.dm
+++ b/code/modules/projectiles/guns/energy/frontier.dm
@@ -30,7 +30,7 @@
if(!do_after(user, 10, src))
break
playsound(get_turf(src),'sound/items/change_drill.ogg',25,1)
- if(power_supply.give(phase_power) < phase_power)
+ if(obj_cell_slot?.cell?.give(phase_power) < phase_power)
break
recharging = 0
@@ -119,7 +119,7 @@
if(!do_after(user, 10, src))
break
playsound(get_turf(src),'sound/items/change_drill.ogg',25,1)
- if(power_supply.give(phase_power) < phase_power)
+ if(obj_cell_slot?.cell?.give(phase_power) < phase_power)
break
recharging = 0
diff --git a/code/modules/projectiles/guns/energy/special/hardlight_bow.dm b/code/modules/projectiles/guns/energy/special/hardlight_bow.dm
index 1b6ce64b3a92..05e7dc94cd63 100644
--- a/code/modules/projectiles/guns/energy/special/hardlight_bow.dm
+++ b/code/modules/projectiles/guns/energy/special/hardlight_bow.dm
@@ -24,7 +24,7 @@
if(!do_after(user, 10, src))
break
playsound(get_turf(src),'sound/weapons/hardlight_bow_charge.ogg',25,1)
- if(power_supply.give(phase_power) < phase_power)
+ if(obj_cell_slot?.cell?.give(phase_power) < phase_power)
break
recharging = 0
From c7ef4e4904facd4f75eeee8d243edebd4834a983 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 9 Sep 2024 19:35:49 +0000
Subject: [PATCH 29/68] that
---
code/__DEFINES/dcs/signals/signals_atom/signals_atom-defense.dm | 2 +-
code/__DEFINES/projectiles/ammo_casing.dm | 2 +-
code/__DEFINES/projectiles/ammo_magazine.dm | 2 +-
code/__DEFINES/projectiles/gun_components.dm | 2 +-
code/__DEFINES/projectiles/guns.dm | 2 +-
code/__DEFINES/projectiles/projectile.dm | 2 +-
code/__DEFINES/projectiles/system.dm | 2 +-
code/datums/components/items/active_parry.dm | 2 +-
code/datums/components/items/passive_parry.dm | 2 +-
code/datums/components/items/shield_block.dm | 2 +-
code/datums/components/mobs/block_frame.dm | 2 +-
code/datums/components/mobs/parry_frame.dm | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom-defense.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom-defense.dm
index 4d20c82cc267..8073142f5edd 100644
--- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom-defense.dm
+++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom-defense.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) Citadel Station Developers *//
+//* Copyright (c) 2024 Citadel Station Developers *//
// todo: integrity signals?
diff --git a/code/__DEFINES/projectiles/ammo_casing.dm b/code/__DEFINES/projectiles/ammo_casing.dm
index 87427678b773..c941f70e08db 100644
--- a/code/__DEFINES/projectiles/ammo_casing.dm
+++ b/code/__DEFINES/projectiles/ammo_casing.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* /obj/item/ammo_casing casing_flags *//
diff --git a/code/__DEFINES/projectiles/ammo_magazine.dm b/code/__DEFINES/projectiles/ammo_magazine.dm
index 325ded8564a3..dfa2ce1db1c6 100644
--- a/code/__DEFINES/projectiles/ammo_magazine.dm
+++ b/code/__DEFINES/projectiles/ammo_magazine.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* /obj/item/ammo_magazine magazine_type
diff --git a/code/__DEFINES/projectiles/gun_components.dm b/code/__DEFINES/projectiles/gun_components.dm
index 18e85ed3abde..3134e8774bca 100644
--- a/code/__DEFINES/projectiles/gun_components.dm
+++ b/code/__DEFINES/projectiles/gun_components.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* Slots - /obj/item/gun_component *//
diff --git a/code/__DEFINES/projectiles/guns.dm b/code/__DEFINES/projectiles/guns.dm
index 669fa02dde97..e5351c043fa5 100644
--- a/code/__DEFINES/projectiles/guns.dm
+++ b/code/__DEFINES/projectiles/guns.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* firing_flags on gun firing procs *//
diff --git a/code/__DEFINES/projectiles/projectile.dm b/code/__DEFINES/projectiles/projectile.dm
index f87cff191198..ac906e1ac987 100644
--- a/code/__DEFINES/projectiles/projectile.dm
+++ b/code/__DEFINES/projectiles/projectile.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* pre_impact(), impact(), bullet_act(), on_impact() impact_flags *//
/// pre_impact, bullet_act, on_impact are called in that order ///
diff --git a/code/__DEFINES/projectiles/system.dm b/code/__DEFINES/projectiles/system.dm
index fafd60aac2ca..7d177322ac9a 100644
--- a/code/__DEFINES/projectiles/system.dm
+++ b/code/__DEFINES/projectiles/system.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* rendering system
//* this is currently only used on ammo magazines, as guns use composition of datums
diff --git a/code/datums/components/items/active_parry.dm b/code/datums/components/items/active_parry.dm
index 1a5dc7dadb9e..6e9bcc8a0fae 100644
--- a/code/datums/components/items/active_parry.dm
+++ b/code/datums/components/items/active_parry.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) Citadel Station Developers *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* generic parry provider on items
diff --git a/code/datums/components/items/passive_parry.dm b/code/datums/components/items/passive_parry.dm
index 678aa914dfca..06d6841ae4dd 100644
--- a/code/datums/components/items/passive_parry.dm
+++ b/code/datums/components/items/passive_parry.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) Citadel Station Developers *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* Shieldcall used as a listener for [/datum/component/passive_parry]
diff --git a/code/datums/components/items/shield_block.dm b/code/datums/components/items/shield_block.dm
index 9e1adc211689..786bfcf499c9 100644
--- a/code/datums/components/items/shield_block.dm
+++ b/code/datums/components/items/shield_block.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) Citadel Station Developers *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* generic shield-like block provider on items
diff --git a/code/datums/components/mobs/block_frame.dm b/code/datums/components/mobs/block_frame.dm
index bbbbedd27b3d..cf3d87c10714 100644
--- a/code/datums/components/mobs/block_frame.dm
+++ b/code/datums/components/mobs/block_frame.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) Citadel Station Developers *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* ## Active Defensives
diff --git a/code/datums/components/mobs/parry_frame.dm b/code/datums/components/mobs/parry_frame.dm
index d56753381192..40eaa336e6d1 100644
--- a/code/datums/components/mobs/parry_frame.dm
+++ b/code/datums/components/mobs/parry_frame.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) Citadel Station Developers *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* ## Active Parry
From d609695acf86661e028e646a5f2af07f2216e377 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 9 Sep 2024 20:05:03 +0000
Subject: [PATCH 30/68] firing cycle
---
code/__DEFINES/projectiles/guns.dm | 14 ++-
.../calibers/special/microbattery.dm | 2 +-
code/modules/projectiles/gun-firing.dm | 91 ++++++++++++++++++-
code/modules/projectiles/gun-modular.dm | 2 +-
code/modules/projectiles/gun.dm | 11 +++
code/modules/projectiles/gun_component.dm | 2 +-
.../gun_components/acceleration_coil.dm | 2 +-
.../gun_components/active_cooler.dm | 2 +-
.../gun_components/energy_handler.dm | 2 +-
.../gun_components/internal_module.dm | 2 +-
.../projectiles/gun_components/power_unit.dm | 2 +-
.../guns/ballistic/magnetic-modular.dm | 2 +-
.../projectiles/guns/ballistic/magnetic.dm | 2 +-
13 files changed, 117 insertions(+), 19 deletions(-)
diff --git a/code/__DEFINES/projectiles/guns.dm b/code/__DEFINES/projectiles/guns.dm
index e5351c043fa5..f781c9059558 100644
--- a/code/__DEFINES/projectiles/guns.dm
+++ b/code/__DEFINES/projectiles/guns.dm
@@ -15,13 +15,17 @@
/// * "This happens all the time" is not a valid excuse to not log a gunshot.
#define GUN_FIRING_NO_LOGGING (1<<3)
-//* firing result from firing procs *//
+//* firing result from firing procs *//
+//* these are flags but should be returned only one at a time. *//
+//* they are flags for fast comparisons. *//
/// fired
-#define GUN_FIRED_SUCCESS 1
+#define GUN_FIRED_SUCCESS 0
/// unknown failure
-#define GUN_FIRED_FAIL_UNKNOWN 2
+#define GUN_FIRED_FAIL_UNKNOWN (1<<0)
/// failed - round wasn't live or the right primer type
-#define GUN_FIRED_FAIL_INERT 3
+#define GUN_FIRED_FAIL_INERT (1<<1)
/// failed - out of ammo
-#define GUN_FIRED_FAIL_EMPTY 4
+#define GUN_FIRED_FAIL_EMPTY (1<<2)
+/// failed - we're no longer being held / mounted / whatever
+#define GUN_FIRED_FAIL_UNMOUNTED (1<<3)
diff --git a/code/modules/projectiles/ammunition/calibers/special/microbattery.dm b/code/modules/projectiles/ammunition/calibers/special/microbattery.dm
index 894ffcd4c0d6..4d1a6684e058 100644
--- a/code/modules/projectiles/ammunition/calibers/special/microbattery.dm
+++ b/code/modules/projectiles/ammunition/calibers/special/microbattery.dm
@@ -1,4 +1,4 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/datum/ammo_caliber/microbattery
diff --git a/code/modules/projectiles/gun-firing.dm b/code/modules/projectiles/gun-firing.dm
index 0dfe01ad5607..9ed711d142eb 100644
--- a/code/modules/projectiles/gun-firing.dm
+++ b/code/modules/projectiles/gun-firing.dm
@@ -1,14 +1,44 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* Firing Cycle *//
-#warn impl all
+/**
+ * async proc to start a firing cycle
+ *
+ * @return firing cycle ID
+ */
+/obj/item/gun/proc/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
+ SHOULD_CALL_PARENT(TRUE)
+ SHOULD_NOT_SLEEP(TRUE)
+ #warn impl
+
+/**
+ * returns a given firing cycle ID; if none is provided, we interrupt any active firing cycle.
+ */
+/obj/item/gun/proc/interrupt_firing_cycle(cycle_id)
+ SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_NOT_OVERRIDE(TRUE)
+
+ firing_cycle = firing_cycle + 1
+
+/**
+ * Hook for firing cycle start
+ */
+/obj/item/gun/proc/on_firing_cycle_start(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
+ SHOULD_NOT_SLEEP(TRUE)
+
+/**
+ * Hook for firing cycle end
+ */
+/obj/item/gun/proc/on_firing_cycle_end(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor, iterations_fired, last_firing_result)
+ SHOULD_NOT_SLEEP(TRUE)
/**
* called exactly once at the start of a firing cycle to start it
*
* @params
+ * * cycle_id - the cycle id to use; this is provided by start_firing_cycle
* * firer - the thing physically firing us; whether a turret or a person
* * angle - the angle to fire in.
* * firing_flags - GUN_FIRING_* flags
@@ -16,10 +46,34 @@
* * target - (optional) what we're firing at
* * actor - (optional) the person who initiated the firing
*/
-/obj/item/gun/proc/firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
+/obj/item/gun/proc/firing_cycle(cycle_id, atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
SHOULD_NOT_OVERRIDE(TRUE)
+ PRIVATE_PROC(TRUE) // only base of /start_firing_cycle is allowed to call us
+
+ /**
+ * As a word of warning, any proc called in this proc must be SHOULD_NOT_SLEEP.
+ * If this is ever violated bad things may happen and things may explode.
+ */
- #warn start_firing_cycle, end_firing_cycle
+ firing_cycle = cycle_id
+
+ var/interrupted = FALSE
+
+ on_firing_cycle_start(firer, angle, firing_flags, firemode, target, actor)
+
+ var/iteration
+ var/iteration_delay
+
+ for(var/iteration in 1 to iterations)
+ var/result = fire(firer, angle, firing_flags, firemode, iteration, target, actor)
+ if(!post_fire(firer, angle, firing_flags, firemode, iteration, result, target, actor))
+ break
+ sleep(iteration_delay)
+ if(firing_cycle != cycle_id)
+ interrupted = TRUE
+ break
+
+ on_firing_cycle_end(firer, angle, firing_flags, firemode, iteratino, target, actor)
//* Firing *//
@@ -36,3 +90,32 @@
* * actor - (optional) the person who initiated the firing
*/
/obj/item/gun/proc/fire(atom/firer, angle, firing_flags, datum/firemode/firemode, iteration, atom/target, datum/event_args/actor/actor)
+ SHOULD_NOT_SLEEP(TRUE)
+ #warn impl; check unmount
+
+/**
+ * Called to handle post fire
+ *
+ * @return FALSE to abort firing cycle
+ */
+/obj/item/gun/proc/post_fire(atom/firer, angle, firing_flags, datum/firemode/firemode, iteration, firing_result, atom/target, datum/event_args/actor/actor)
+ SHOULD_NOT_SLEEP(TRUE)
+ switch(firing_result)
+ if(GUN_FIRED_SUCCESS)
+ return TRUE
+ if(GUN_FIRED_FAIL_EMPTY, GUN_FIRED_FAIL_INERT)
+ post_empty_fire(actor, target)
+ else
+ return FALSE
+
+//* Firing - Default Handlers (Overridable) *//
+
+/**
+ * Called if someone tries to fire us without live ammo in the chamber (or chamber-equivalent)
+ *
+ * @params
+ * * actor - (optional) the actor tuple describing who's firing us, if any.
+ * * target - (optional) what we were being fired at
+ */
+/obj/item/gun/proc/post_empty_fire(datum/event_args/actor/actor, atom/target)
+ #warn impl
diff --git a/code/modules/projectiles/gun-modular.dm b/code/modules/projectiles/gun-modular.dm
index 02259435d28d..ee9e0ef97776 100644
--- a/code/modules/projectiles/gun-modular.dm
+++ b/code/modules/projectiles/gun-modular.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
//* Modular Components - Compatibility *//
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index b58bf3d880d2..70f734169f2c 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -69,6 +69,17 @@
/// * this is a default value; set to null by default to have the projectile's say.
var/accuracy_disabled = null
+ //* Firing *//
+
+ /// the current firing cycle
+ ///
+ /// * to interrupt a firing cycle, just change it.
+ var/tmp/firing_cycle
+ /// the next firing cycle
+ ///
+ /// * static var; technically can collide. realistically, won't.
+ var/static/firing_cycle_next = 0
+
// legacy below //
var/burst = 1
diff --git a/code/modules/projectiles/gun_component.dm b/code/modules/projectiles/gun_component.dm
index 5b2a6249f424..9c39deee0ec1 100644
--- a/code/modules/projectiles/gun_component.dm
+++ b/code/modules/projectiles/gun_component.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* A component used in guns with modular parts.
diff --git a/code/modules/projectiles/gun_components/acceleration_coil.dm b/code/modules/projectiles/gun_components/acceleration_coil.dm
index 58d0c1a07a42..f90e1039463d 100644
--- a/code/modules/projectiles/gun_components/acceleration_coil.dm
+++ b/code/modules/projectiles/gun_components/acceleration_coil.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun_component/acceleration_coil
name = "weapon acceleration coil"
diff --git a/code/modules/projectiles/gun_components/active_cooler.dm b/code/modules/projectiles/gun_components/active_cooler.dm
index 57113a314a0c..e228c80dee8f 100644
--- a/code/modules/projectiles/gun_components/active_cooler.dm
+++ b/code/modules/projectiles/gun_components/active_cooler.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun_component/active_cooler
name = "weapon cooler"
diff --git a/code/modules/projectiles/gun_components/energy_handler.dm b/code/modules/projectiles/gun_components/energy_handler.dm
index 6d48b16bcbe0..12a81f717475 100644
--- a/code/modules/projectiles/gun_components/energy_handler.dm
+++ b/code/modules/projectiles/gun_components/energy_handler.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun_component/energy_handler
name = "weapon energy handler"
diff --git a/code/modules/projectiles/gun_components/internal_module.dm b/code/modules/projectiles/gun_components/internal_module.dm
index 593cc479d0a2..d0995e2ce41d 100644
--- a/code/modules/projectiles/gun_components/internal_module.dm
+++ b/code/modules/projectiles/gun_components/internal_module.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun_component/internal_module
name = "weapon module"
diff --git a/code/modules/projectiles/gun_components/power_unit.dm b/code/modules/projectiles/gun_components/power_unit.dm
index 7b4c5042dc4c..51e7d8077568 100644
--- a/code/modules/projectiles/gun_components/power_unit.dm
+++ b/code/modules/projectiles/gun_components/power_unit.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun_component/power_unit
name = "weapon power unit"
diff --git a/code/modules/projectiles/guns/ballistic/magnetic-modular.dm b/code/modules/projectiles/guns/ballistic/magnetic-modular.dm
index ebe20e63aa88..6627a47947b1 100644
--- a/code/modules/projectiles/guns/ballistic/magnetic-modular.dm
+++ b/code/modules/projectiles/guns/ballistic/magnetic-modular.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun/ballistic/magnetic/modular
diff --git a/code/modules/projectiles/guns/ballistic/magnetic.dm b/code/modules/projectiles/guns/ballistic/magnetic.dm
index 5a9d49767fd7..e5d8a4501729 100644
--- a/code/modules/projectiles/guns/ballistic/magnetic.dm
+++ b/code/modules/projectiles/guns/ballistic/magnetic.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/obj/item/gun/ballistic/magnetic
cell_system = TRUE
From 1407a611bf8d7a35606f17e63e996f4a6853097d Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 9 Sep 2024 21:00:53 +0000
Subject: [PATCH 31/68] progres
---
citadel.dme | 1 +
code/__DEFINES/projectiles/guns.dm | 4 ++
code/modules/projectiles/gun-firing.dm | 43 +++++++++++++++----
.../gun-projectile-implementation.dm | 25 +++++++++++
code/modules/projectiles/gun.dm | 11 +----
5 files changed, 67 insertions(+), 17 deletions(-)
create mode 100644 code/modules/projectiles/gun-projectile-implementation.dm
diff --git a/citadel.dme b/citadel.dme
index 0ef1aa6dc1cf..f65ebfa3fc8a 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4389,6 +4389,7 @@
#include "code\modules\projectiles\firing_pin.dm"
#include "code\modules\projectiles\gun-firing.dm"
#include "code\modules\projectiles\gun-modular.dm"
+#include "code\modules\projectiles\gun-projectile-implementation.dm"
#include "code\modules\projectiles\gun.dm"
#include "code\modules\projectiles\gun_component.dm"
#include "code\modules\projectiles\gun_item_renderer.dm"
diff --git a/code/__DEFINES/projectiles/guns.dm b/code/__DEFINES/projectiles/guns.dm
index f781c9059558..2c40eb391c80 100644
--- a/code/__DEFINES/projectiles/guns.dm
+++ b/code/__DEFINES/projectiles/guns.dm
@@ -14,6 +14,10 @@
/// * This is an extremely dangerous flag. Do not use unless you are already logging it somewhere else.
/// * "This happens all the time" is not a valid excuse to not log a gunshot.
#define GUN_FIRING_NO_LOGGING (1<<3)
+/// do not call default click empty
+#define GUN_FIRING_NO_CLICK_EMPTY (1<<4)
+/// suppressed shot
+#define GUN_FIRING_SUPPRESSED (1<<5)
//* firing result from firing procs *//
//* these are flags but should be returned only one at a time. *//
diff --git a/code/modules/projectiles/gun-firing.dm b/code/modules/projectiles/gun-firing.dm
index 9ed711d142eb..5550ffa8eae1 100644
--- a/code/modules/projectiles/gun-firing.dm
+++ b/code/modules/projectiles/gun-firing.dm
@@ -11,6 +11,17 @@
/obj/item/gun/proc/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
SHOULD_CALL_PARENT(TRUE)
SHOULD_NOT_SLEEP(TRUE)
+
+ /**
+ * it's important we invoke async, **not** spawn(0)
+ *
+ * this is so debugging and other systems that care about call stack
+ * still attribute the call to the user until it sleeps for the first time
+ *
+ * just because we support async doesn't mean we actually want it
+ * to be async unless it needs to be; there's no reason to do so
+ * (and if something weird is going on we do want the initial proc to be attributed to the caller)
+ */
#warn impl
/**
@@ -61,19 +72,22 @@
on_firing_cycle_start(firer, angle, firing_flags, firemode, target, actor)
- var/iteration
+ var/iterations
var/iteration_delay
+ #warn impl stuff
+
for(var/iteration in 1 to iterations)
var/result = fire(firer, angle, firing_flags, firemode, iteration, target, actor)
if(!post_fire(firer, angle, firing_flags, firemode, iteration, result, target, actor))
break
- sleep(iteration_delay)
- if(firing_cycle != cycle_id)
- interrupted = TRUE
- break
+ if(iteration != iterations)
+ sleep(iteration_delay)
+ if(firing_cycle != cycle_id)
+ interrupted = TRUE
+ break
- on_firing_cycle_end(firer, angle, firing_flags, firemode, iteratino, target, actor)
+ on_firing_cycle_end(firer, angle, firing_flags, firemode, iteration, target, actor)
//* Firing *//
@@ -104,7 +118,7 @@
if(GUN_FIRED_SUCCESS)
return TRUE
if(GUN_FIRED_FAIL_EMPTY, GUN_FIRED_FAIL_INERT)
- post_empty_fire(actor, target)
+ post_empty_fire(firing_flags, actor, target)
else
return FALSE
@@ -114,8 +128,21 @@
* Called if someone tries to fire us without live ammo in the chamber (or chamber-equivalent)
*
* @params
+ * * firing_flags - our firing flags
* * actor - (optional) the actor tuple describing who's firing us, if any.
* * target - (optional) what we were being fired at
*/
-/obj/item/gun/proc/post_empty_fire(datum/event_args/actor/actor, atom/target)
+/obj/item/gun/proc/post_empty_fire(firing_flags, datum/event_args/actor/actor, atom/target)
+ if(!(firing_flags & GUN_FIRING_NO_CLICK_EMPTY))
+ // default click empty
+ default_click_empty()
#warn impl
+
+// todo: actor / event_args support
+/obj/item/gun/proc/default_click_empty()
+ var/mob/holding_us = worn_mob()
+ if(holding_us)
+ holding_us.visible_message(SPAN_WARNING("*click click*"), SPAN_WARNING("*click*"))
+ else if(isturf(loc))
+ visible_message(SPAN_WARNING("*click click*"), SPAN_WARNING("*click*"))
+ playsound(src, 'sound/weapons/empty.ogg', 75, TRUE)
diff --git a/code/modules/projectiles/gun-projectile-implementation.dm b/code/modules/projectiles/gun-projectile-implementation.dm
new file mode 100644
index 000000000000..445bed484a42
--- /dev/null
+++ b/code/modules/projectiles/gun-projectile-implementation.dm
@@ -0,0 +1,25 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/**
+ * tl;dr
+ *
+ * we want eventually /gun/projectile so we don't have to have special behavior on /gun/launcher
+ * and similar 'guns' that aren't actually projectile guns
+ *
+ * this way we have separation between behaviors only needed on guns that shoot
+ * /obj/projectile's. that said, this is a little annoying to do (path length bloat)
+ * so for now we put the projectile procs in their own file.
+ */
+
+/**
+ * Obtains the next projectile to fire.
+ *
+ * Either will return an /obj/projectile,
+ * or return a GUN_FIRED_* define that is not SUCCESS.
+ *
+ * * Things like jams go in here.
+ * * Things like 'the next bullet is empty so we fail' go in here
+ */
+/obj/item/gun/proc/process_next_projectile()
+ #warn impl
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 70f734169f2c..6d2434319781 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -631,8 +631,9 @@
set_light(0)
//obtains the next projectile to fire
+#warn get rid of this
/obj/item/gun/proc/consume_next_projectile()
- return null
+ SHOULD_NOT_OVERRIDE(TRUE)
//used by aiming code
/obj/item/gun/proc/can_hit(atom/target as mob, var/mob/living/user as mob)
@@ -643,14 +644,6 @@
if(check_trajectory(target, user))
return 1 // Magic numbers are fun.
-//called if there was no projectile to shoot
-/obj/item/gun/proc/handle_click_empty(mob/user)
- if (user)
- user.visible_message("*click click*", "*click*")
- else
- visible_message("*click click*")
- playsound(src, 'sound/weapons/empty.ogg', 100, 1)
-
/obj/item/gun/proc/handle_click_safety(mob/user)
user.visible_message(SPAN_WARNING("[user] squeezes the trigger of \the [src] but it doesn't move!"), SPAN_WARNING("You squeeze the trigger but it doesn't move!"), range = MESSAGE_RANGE_COMBAT_SILENCED)
From 66253ba7beead2190b721df87a995e50c67d4199 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 15:14:41 +0000
Subject: [PATCH 32/68] sigh, launcher crap.
---
code/modules/clothing/chameleon.dm | 4 +-
code/modules/projectiles/gun-firing.dm | 16 ++++++--
.../projectiles/guns/ballistic/dartgun.dm | 2 +-
.../ballistic/microbattery/microbattery.dm | 2 +-
.../projectiles/guns/ballistic/pistol.dm | 7 ++--
.../projectiles/guns/ballistic/revolver.dm | 3 +-
.../projectiles/guns/ballistic/rocket.dm | 13 +++----
.../projectiles/guns/ballistic/shotgun.dm | 6 +--
code/modules/projectiles/guns/energy.dm | 2 +-
.../projectiles/guns/energy/sizegun_vr.dm | 2 +-
.../projectiles/guns/energy/special.dm | 39 +------------------
code/modules/projectiles/guns/launcher.dm | 6 +++
.../projectiles/guns/launcher/crossbow.dm | 12 ++++--
.../projectiles/guns/launcher/pneumatic.dm | 2 +-
.../projectiles/guns/launcher/syringe_gun.dm | 2 +-
code/modules/projectiles/guns/magnetic.dm | 5 +--
code/modules/projectiles/guns/vox.dm | 2 +-
.../projectile/subtypes/special.dm | 23 +++--------
18 files changed, 56 insertions(+), 92 deletions(-)
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index f1c6e2033a18..62e807c8b618 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -380,9 +380,9 @@
var/obj/item/gun/G = gun_type
src.gun_choices[initial(G.name)] = gun_type
-/obj/item/gun/energy/chameleon/consume_next_projectile()
+/obj/item/gun/energy/chameleon/process_next_projectile()
var/obj/projectile/P = ..()
- if(P && ispath(copy_projectile))
+ if(istype(P) && ispath(copy_projectile))
P.name = initial(copy_projectile.name)
P.icon = initial(copy_projectile.icon)
P.icon_state = initial(copy_projectile.icon_state)
diff --git a/code/modules/projectiles/gun-firing.dm b/code/modules/projectiles/gun-firing.dm
index 5550ffa8eae1..7371fa837abc 100644
--- a/code/modules/projectiles/gun-firing.dm
+++ b/code/modules/projectiles/gun-firing.dm
@@ -6,7 +6,7 @@
/**
* async proc to start a firing cycle
*
- * @return firing cycle ID
+ * @return firing cycle ID on success, null on fail.
*/
/obj/item/gun/proc/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
SHOULD_CALL_PARENT(TRUE)
@@ -73,21 +73,29 @@
on_firing_cycle_start(firer, angle, firing_flags, firemode, target, actor)
var/iterations
+ var/iterations_fired = 0
var/iteration_delay
+ var/last_firing_result
#warn impl stuff
for(var/iteration in 1 to iterations)
- var/result = fire(firer, angle, firing_flags, firemode, iteration, target, actor)
- if(!post_fire(firer, angle, firing_flags, firemode, iteration, result, target, actor))
+ last_firing_result = fire(firer, angle, firing_flags, firemode, iteration, target, actor)
+
+ switch(last_firing_result)
+ if(GUN_FIRED_SUCCESS)
+ iterations_fired++
+
+ if(!post_fire(firer, angle, firing_flags, firemode, iteration, last_firing_result, target, actor))
break
+
if(iteration != iterations)
sleep(iteration_delay)
if(firing_cycle != cycle_id)
interrupted = TRUE
break
- on_firing_cycle_end(firer, angle, firing_flags, firemode, iteration, target, actor)
+ on_firing_cycle_end(firer, angle, firing_flags, firemode, target, actor, iterations_fired, last_firing_result)
//* Firing *//
diff --git a/code/modules/projectiles/guns/ballistic/dartgun.dm b/code/modules/projectiles/guns/ballistic/dartgun.dm
index e56464d94482..89789304d865 100644
--- a/code/modules/projectiles/guns/ballistic/dartgun.dm
+++ b/code/modules/projectiles/guns/ballistic/dartgun.dm
@@ -52,7 +52,7 @@
else
icon_state = "[base_state]"
-/obj/item/gun/ballistic/dartgun/consume_next_projectile()
+/obj/item/gun/ballistic/dartgun/process_next_projectile()
. = ..()
var/obj/projectile/bullet/chemdart/dart = .
if(istype(dart))
diff --git a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
index a095b680d660..15924963a4ca 100644
--- a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
+++ b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
@@ -26,7 +26,7 @@
var/max_charge = 0
charge_sections = 5
-/obj/item/gun/ballistic/microbattery/consume_next_projectile()
+/obj/item/gun/ballistic/microbattery/process_next_projectile()
if(chambered && ammo_magazine)
var/obj/item/ammo_casing/microbattery/batt = chambered
if(batt.shots_left)
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index b0ea5a040444..02d848edd5ac 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -249,12 +249,13 @@
caliber = initial(ammo.caliber)
return ..()
-/obj/item/gun/ballistic/pirate/consume_next_projectile(mob/user as mob)
+// todo: dumb
+/obj/item/gun/ballistic/pirate/process_next_projectile()
. = ..()
if(.)
if(unstable)
if(prob(10))
- to_chat(user, "The barrel bursts open as the gun backfires!")
+ visible_message("The barrel bursts open on [src] as the gun backfires!")
name = "destroyed zip gun"
desc = "The barrel has burst. It seems inoperable."
icon_state = "[initial(icon_state)]-destroyed"
@@ -263,8 +264,6 @@
explosion(get_turf(src), -1, 0, 2, 3)
if(destroyed)
- to_chat(user, "The [src] is broken!")
- handle_click_empty()
return
/obj/item/gun/ballistic/pirate/Fire(atom/target, mob/living/user, clickparams, pointblank, reflex)
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index 66e7d6bf471d..b8a96c679c1d 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -30,7 +30,8 @@
if(rand(1,max_shells) > loaded.len)
chamber_offset = rand(0,max_shells - loaded.len)
-/obj/item/gun/ballistic/revolver/consume_next_projectile()
+// todo: dumb
+/obj/item/gun/ballistic/revolver/process_next_projectile()
if(chamber_offset)
chamber_offset--
return
diff --git a/code/modules/projectiles/guns/ballistic/rocket.dm b/code/modules/projectiles/guns/ballistic/rocket.dm
index 12dac8984e58..73dee27c2cf0 100644
--- a/code/modules/projectiles/guns/ballistic/rocket.dm
+++ b/code/modules/projectiles/guns/ballistic/rocket.dm
@@ -108,11 +108,7 @@
item_state = "[initial(item_state)]"
collapsed = 1
-/obj/item/gun/ballistic/rocket/collapsible/examine(mob/user, dist)
- . = ..()
- return
-
-/obj/item/gun/ballistic/rocket/collapsible/consume_next_projectile(mob/user as mob)
+/obj/item/gun/ballistic/rocket/collapsible/process_next_projectile()
. = ..()
if(empty)
return
@@ -130,13 +126,14 @@
handle_casings = HOLD_CASINGS
unstable = 1
-/obj/item/gun/ballistic/rocket/tyrmalin/consume_next_projectile(mob/user as mob)
+// todo: dumb
+/obj/item/gun/ballistic/rocket/tyrmalin/process_next_projectile()
. = ..()
if(.)
if(unstable)
switch(rand(1,100))
if(1 to 5)
- to_chat(user, "The rocket primer activates early!")
+ visible_message("The rocket primer on [src] activates early!")
icon_state = "rokkitlauncher-malfunction"
spawn(rand(2 SECONDS, 5 SECONDS))
if(src && !destroyed)
@@ -146,7 +143,7 @@
qdel(src)
return ..()
if(6 to 20)
- to_chat(user, "The rocket flares out in the tube!")
+ visible_message("The rocket in [src] flares out in the tube!")
playsound(src, 'sound/machines/button.ogg', 25)
icon_state = "rokkitlauncher-broken"
destroyed = 1
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index 96bd6b3fbd2f..988f0f485679 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -21,10 +21,8 @@
var/animated_pump = 0 //This is for cyling animations.
var/empty_sprite = 0 //This is just a dirty var so it doesn't fudge up.
-/obj/item/gun/ballistic/shotgun/pump/consume_next_projectile()
- if(chambered)
- return chambered.get_projectile()
- return null
+/obj/item/gun/ballistic/shotgun/pump/process_next_projectile()
+ return chambered?.get_projectile()
/obj/item/gun/ballistic/shotgun/pump/attack_self(mob/user)
// todo: this breaks other attack self interactions :(
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 680ba5915eac..8a1b396aa57c 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -102,7 +102,7 @@
..()
update_icon()
-/obj/item/gun/energy/consume_next_projectile()
+/obj/item/gun/energy/process_next_projectile()
if(!obj_cell_slot?.cell)
return null
if(!ispath(projectile_type))
diff --git a/code/modules/projectiles/guns/energy/sizegun_vr.dm b/code/modules/projectiles/guns/energy/sizegun_vr.dm
index ca628cdc0198..08d063645470 100644
--- a/code/modules/projectiles/guns/energy/sizegun_vr.dm
+++ b/code/modules/projectiles/guns/energy/sizegun_vr.dm
@@ -34,7 +34,7 @@
. = ..()
select_size()
-/obj/item/gun/energy/sizegun/consume_next_projectile()
+/obj/item/gun/energy/sizegun/process_next_projectile()
. = ..()
var/obj/projectile/beam/sizelaser/G = .
if(istype(G))
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index c97a2f4f50ee..57e0f158cd7b 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -77,9 +77,7 @@
to_chat(usr, "You set the [src]'s targeted genetic area to [genemask].")
- return
-
-/obj/item/gun/energy/floragun/consume_next_projectile()
+/obj/item/gun/energy/floragun/process_next_projectile()
. = ..()
var/obj/projectile/energy/floramut/gene/G = .
if(istype(G))
@@ -495,23 +493,6 @@
else
return
-/obj/item/gun/energy/plasma/consume_next_projectile(mob/user as mob)
- . = ..()
- if(src.projectile_type == /obj/projectile/plasma/hot)
- switch(rand(1,6))
- if(1)
- to_chat(user, "The containment coil catastrophically overheats!")
- overheating = 1
- spawn(rand(2 SECONDS,5 SECONDS))
- if(src)
- visible_message("\The [src] detonates!")
- explosion(get_turf(src), -1, 0, 2, 3)
- qdel(chambered)
- qdel(src)
- return ..()
- if(2 to 6)
- return ..()
-
/obj/item/gun/energy/plasma/pistol
name = "\improper Wyrm plasma pistol"
desc = "This scaled down NT-PLP-EX 'Wyrm' plasma pistol fires magnetically contained balls of plasma at high velocity. Due to the volatility of the round, the weapon is known to overheat and fail catastrophically if fired too frequently."
@@ -531,21 +512,3 @@
update_held_icon()
else
return
-
-/obj/item/gun/energy/plasma/pistol/consume_next_projectile(mob/user as mob)
- . = ..()
- if(.)
- if(src.projectile_type == /obj/projectile/plasma/hot)
- switch(rand(1,6))
- if(1)
- to_chat(user, "The containment coil catastrophically overheats!")
- overheating = 1
- spawn(rand(2 SECONDS,5 SECONDS))
- if(src)
- visible_message("\The [src] detonates!")
- explosion(get_turf(src), -1, 0, 2, 3)
- qdel(chambered)
- qdel(src)
- return ..()
- if(2 to 6)
- return ..()
diff --git a/code/modules/projectiles/guns/launcher.dm b/code/modules/projectiles/guns/launcher.dm
index b30a63f94fd6..8f9b97ef5835 100644
--- a/code/modules/projectiles/guns/launcher.dm
+++ b/code/modules/projectiles/guns/launcher.dm
@@ -25,3 +25,9 @@
projectile.forceMove(get_turf(user))
projectile.throw_at_old(target, throw_distance, release_force, user)
return 1
+
+/**
+ * Returns the next /atom/movable to throw, or a GUN_FIRED_* for fail satus.
+ */
+/obj/item/gun/launcher/proc/process_next_entity()
+ return
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index 6738cc275a10..a3755d1c22ef 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -72,10 +72,16 @@
/obj/item/gun/launcher/crossbow/update_release_force()
release_force = tension*release_speed
-/obj/item/gun/launcher/crossbow/consume_next_projectile(mob/user=null)
+/obj/item/gun/launcher/crossbow/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
if(tension <= 0)
- to_chat(user, "\The [src] is not drawn back!")
- return null
+ actor?.chat_feedback(
+ SPAN_WARNING("The bolt on [src] isn't drawn back!"),
+ target = src,
+ )
+ return
+ return ..()
+
+/obj/item/gun/launcher/crossbow/process_next_entity()
return bolt
/obj/item/gun/launcher/crossbow/handle_post_fire(mob/user, atom/target)
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index cd73e8f1bfb8..3bc72527a3ce 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -83,7 +83,7 @@
return
eject_tank(user)
-/obj/item/gun/launcher/pneumatic/consume_next_projectile(mob/user=null)
+/obj/item/gun/launcher/pneumatic/process_next_entity()
if(!item_storage.contents.len)
return null
if (!tank)
diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm
index 4461b6a2c85e..45e94d9ba0c6 100644
--- a/code/modules/projectiles/guns/launcher/syringe_gun.dm
+++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm
@@ -84,7 +84,7 @@
var/max_darts = 1
var/obj/item/syringe_cartridge/next
-/obj/item/gun/launcher/syringe/consume_next_projectile()
+/obj/item/gun/launcher/syringe/process_next_entity()
if(next)
next.prime()
return next
diff --git a/code/modules/projectiles/guns/magnetic.dm b/code/modules/projectiles/guns/magnetic.dm
index b281dbc9ef4b..1b1551672128 100644
--- a/code/modules/projectiles/guns/magnetic.dm
+++ b/code/modules/projectiles/guns/magnetic.dm
@@ -165,8 +165,7 @@
qdel(loaded)
loaded = null
-/obj/item/gun/magnetic/consume_next_projectile()
-
+/obj/item/gun/magnetic/process_next_projectile()
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
@@ -207,7 +206,7 @@
capacitor = new /obj/item/stock_parts/capacitor
return ..()
-/obj/item/gun/magnetic/fuelrod/consume_next_projectile()
+/obj/item/gun/magnetic/fuelrod/process_next_projectile()
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
diff --git a/code/modules/projectiles/guns/vox.dm b/code/modules/projectiles/guns/vox.dm
index fae9a54c0d21..af68cabbc270 100644
--- a/code/modules/projectiles/guns/vox.dm
+++ b/code/modules/projectiles/guns/vox.dm
@@ -46,7 +46,7 @@
/obj/item/gun/launcher/spikethrower/update_release_force()
return
-/obj/item/gun/launcher/spikethrower/consume_next_projectile()
+/obj/item/gun/launcher/spikethrower/process_next_entity()
if(spikes < 1) return null
spikes--
return new /obj/item/spike(src)
diff --git a/code/modules/projectiles/projectile/subtypes/special.dm b/code/modules/projectiles/projectile/subtypes/special.dm
index 4a9a66057a41..cfc65a4b1d07 100644
--- a/code/modules/projectiles/projectile/subtypes/special.dm
+++ b/code/modules/projectiles/projectile/subtypes/special.dm
@@ -390,31 +390,18 @@
//Plasma Burst
/obj/projectile/plasma
- name ="plasma bolt"
+ name = "plasma bolt"
icon_state= "fuel-tritium"
- damage_force = 50
- damage_type = BURN
+ damage_force = 20
+ damage_type = DAMAGE_TYPE_BURN
damage_flag = ARMOR_ENERGY
light_range = 4
light_power = 3
light_color = "#00ccff"
- var/heavy = FALSE
-
-/obj/projectile/plasma/on_impact(atom/target, impact_flags, def_zone, efficiency)
- . = ..()
- if(. & PROJECTILE_IMPACT_FLAGS_UNCONDITIONAL_ABORT)
- return
-
- var/blast_dir = src.dir
- target.visible_message("\The [target] is engulfed in roiling plasma!")
- var/blastloc = get_step(target, blast_dir)
- if(blastloc)
- explosion(blastloc, -1, 0, heavy? 2 : 1, heavy? 3 : 2)
/obj/projectile/plasma/hot
- name ="heavy plasma bolt"
- damage_force = 75
+ name = "heavy plasma bolt"
+ damage_force = 35
light_range = 5
light_power = 4
light_color = "#00ccff"
- heavy = TRUE
From 83060d0b93987261eca6e971263c39ae0e59bc5d Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 15:23:04 +0000
Subject: [PATCH 33/68] that
---
code/modules/clothing/chameleon.dm | 2 +-
.../projectiles/gun-projectile-implementation.dm | 10 +++++++++-
code/modules/projectiles/guns/ballistic.dm | 5 +++--
.../modules/projectiles/guns/ballistic/contender.dm | 5 ++---
code/modules/projectiles/guns/ballistic/dartgun.dm | 2 +-
.../guns/ballistic/microbattery/microbattery.dm | 2 +-
code/modules/projectiles/guns/ballistic/pistol.dm | 2 +-
code/modules/projectiles/guns/ballistic/revolver.dm | 2 +-
code/modules/projectiles/guns/ballistic/rocket.dm | 5 ++---
code/modules/projectiles/guns/ballistic/shotgun.dm | 2 +-
code/modules/projectiles/guns/energy.dm | 2 +-
code/modules/projectiles/guns/energy/laser.dm | 6 +++---
code/modules/projectiles/guns/energy/sizegun_vr.dm | 2 +-
code/modules/projectiles/guns/energy/special.dm | 2 +-
code/modules/projectiles/guns/launcher.dm | 2 +-
code/modules/projectiles/guns/launcher/crossbow.dm | 2 +-
code/modules/projectiles/guns/launcher/pneumatic.dm | 13 +++++++------
.../projectiles/guns/launcher/syringe_gun.dm | 2 +-
code/modules/projectiles/guns/magic.dm | 2 +-
code/modules/projectiles/guns/magnetic.dm | 4 ++--
code/modules/projectiles/guns/vox.dm | 2 +-
21 files changed, 42 insertions(+), 34 deletions(-)
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index 62e807c8b618..4cd9dc5cd10b 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -380,7 +380,7 @@
var/obj/item/gun/G = gun_type
src.gun_choices[initial(G.name)] = gun_type
-/obj/item/gun/energy/chameleon/process_next_projectile()
+/obj/item/gun/energy/chameleon/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
var/obj/projectile/P = ..()
if(istype(P) && ispath(copy_projectile))
P.name = initial(copy_projectile.name)
diff --git a/code/modules/projectiles/gun-projectile-implementation.dm b/code/modules/projectiles/gun-projectile-implementation.dm
index 445bed484a42..7aa8648c5d53 100644
--- a/code/modules/projectiles/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/gun-projectile-implementation.dm
@@ -20,6 +20,14 @@
*
* * Things like jams go in here.
* * Things like 'the next bullet is empty so we fail' go in here
+ * * Everything is optional here. Things like portable turrets reserve the right to 'pull' from the gun without caring about params.
+ *
+ * @params
+ * * iteration - (optional) the iteration of the fire
+ * * firing_flags - (optional) GUN_FIRING_* flags
+ * * firemode - (optional) the firemode
+ * * actor - (optional) the initiator
+ * * firer - (optional) the actual firer.
*/
-/obj/item/gun/proc/process_next_projectile()
+/obj/item/gun/proc/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
#warn impl
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index 01d3557070c3..cc74c7ad3094 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -2,7 +2,7 @@
* Ballistic Guns
*
* These are guns that fire primarily ammo casings.
- *
+ *
* They have simulation / support for both direct-load / internal magazines, as well as
* attached / inserted external magazines.
*/
@@ -77,7 +77,8 @@
if(magazine_type)
icon_state = "[silenced_state][magazine_state]"
-/obj/item/gun/ballistic/consume_next_projectile()
+// todo: rework
+/obj/item/gun/ballistic/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
//get the next casing
if(loaded.len)
chambered = loaded[1] //load next casing.
diff --git a/code/modules/projectiles/guns/ballistic/contender.dm b/code/modules/projectiles/guns/ballistic/contender.dm
index 0f3b1290d361..721c02ee0be4 100644
--- a/code/modules/projectiles/guns/ballistic/contender.dm
+++ b/code/modules/projectiles/guns/ballistic/contender.dm
@@ -104,13 +104,12 @@
projectile_type = /obj/projectile/bullet/shotgun
unstable = 1
-/obj/item/gun/ballistic/contender/pipegun/consume_next_projectile(mob/user as mob)
+/obj/item/gun/ballistic/contender/pipegun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
- //var/instability = rand(1,100)
if(.)
if(unstable)
if(prob(10))
- to_chat(user, "The pipe bursts open as the gun backfires!")
+ visible_message("The pipe bursts open on [src] as the gun backfires!")
name = "ruptured pipe rifle"
desc = "The barrel has blown wide open."
icon_state = "pipegun-destroyed"
diff --git a/code/modules/projectiles/guns/ballistic/dartgun.dm b/code/modules/projectiles/guns/ballistic/dartgun.dm
index 89789304d865..c2704b2faa88 100644
--- a/code/modules/projectiles/guns/ballistic/dartgun.dm
+++ b/code/modules/projectiles/guns/ballistic/dartgun.dm
@@ -52,7 +52,7 @@
else
icon_state = "[base_state]"
-/obj/item/gun/ballistic/dartgun/process_next_projectile()
+/obj/item/gun/ballistic/dartgun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
var/obj/projectile/bullet/chemdart/dart = .
if(istype(dart))
diff --git a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
index 15924963a4ca..0d78d76eba49 100644
--- a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
+++ b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
@@ -26,7 +26,7 @@
var/max_charge = 0
charge_sections = 5
-/obj/item/gun/ballistic/microbattery/process_next_projectile()
+/obj/item/gun/ballistic/microbattery/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(chambered && ammo_magazine)
var/obj/item/ammo_casing/microbattery/batt = chambered
if(batt.shots_left)
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index 02d848edd5ac..96d9e30873e3 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -250,7 +250,7 @@
return ..()
// todo: dumb
-/obj/item/gun/ballistic/pirate/process_next_projectile()
+/obj/item/gun/ballistic/pirate/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index b8a96c679c1d..9afa1e3e1497 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -31,7 +31,7 @@
chamber_offset = rand(0,max_shells - loaded.len)
// todo: dumb
-/obj/item/gun/ballistic/revolver/process_next_projectile()
+/obj/item/gun/ballistic/revolver/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(chamber_offset)
chamber_offset--
return
diff --git a/code/modules/projectiles/guns/ballistic/rocket.dm b/code/modules/projectiles/guns/ballistic/rocket.dm
index 73dee27c2cf0..8b816de7892a 100644
--- a/code/modules/projectiles/guns/ballistic/rocket.dm
+++ b/code/modules/projectiles/guns/ballistic/rocket.dm
@@ -108,7 +108,7 @@
item_state = "[initial(item_state)]"
collapsed = 1
-/obj/item/gun/ballistic/rocket/collapsible/process_next_projectile()
+/obj/item/gun/ballistic/rocket/collapsible/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(empty)
return
@@ -127,7 +127,7 @@
unstable = 1
// todo: dumb
-/obj/item/gun/ballistic/rocket/tyrmalin/process_next_projectile()
+/obj/item/gun/ballistic/rocket/tyrmalin/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
@@ -154,7 +154,6 @@
return 1
if(destroyed)
- to_chat(user, "The [src] is broken!")
handle_click_empty()
return
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index 988f0f485679..84a9057a7727 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -21,7 +21,7 @@
var/animated_pump = 0 //This is for cyling animations.
var/empty_sprite = 0 //This is just a dirty var so it doesn't fudge up.
-/obj/item/gun/ballistic/shotgun/pump/process_next_projectile()
+/obj/item/gun/ballistic/shotgun/pump/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return chambered?.get_projectile()
/obj/item/gun/ballistic/shotgun/pump/attack_self(mob/user)
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 8a1b396aa57c..4bf97609db74 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -102,7 +102,7 @@
..()
update_icon()
-/obj/item/gun/energy/process_next_projectile()
+/obj/item/gun/energy/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!obj_cell_slot?.cell)
return null
if(!ispath(projectile_type))
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 9e2f8a0ed448..e3d6d0a47639 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -315,19 +315,19 @@
cell_type = /obj/item/cell/device/weapon
unstable = 1
-/obj/item/gun/energy/zip/consume_next_projectile(mob/user as mob)
+// todo: this is dumb
+/obj/item/gun/energy/zip/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
if(prob(10))
to_chat(user, "The cell overcooks and ruptures!")
spawn(rand(2 SECONDS,5 SECONDS))
- if(src)
+ if(!QDELETED(src))
visible_message("\The [src] detonates!")
explosion(get_turf(src), -1, 0, 2, 3)
qdel(chambered)
qdel(src)
- return ..()
//NT SpecOps Laser Rifle
/obj/item/gun/energy/combat
diff --git a/code/modules/projectiles/guns/energy/sizegun_vr.dm b/code/modules/projectiles/guns/energy/sizegun_vr.dm
index 08d063645470..dc84fa265130 100644
--- a/code/modules/projectiles/guns/energy/sizegun_vr.dm
+++ b/code/modules/projectiles/guns/energy/sizegun_vr.dm
@@ -34,7 +34,7 @@
. = ..()
select_size()
-/obj/item/gun/energy/sizegun/process_next_projectile()
+/obj/item/gun/energy/sizegun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
var/obj/projectile/beam/sizelaser/G = .
if(istype(G))
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 57e0f158cd7b..20b4174bce68 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -77,7 +77,7 @@
to_chat(usr, "You set the [src]'s targeted genetic area to [genemask].")
-/obj/item/gun/energy/floragun/process_next_projectile()
+/obj/item/gun/energy/floragun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
var/obj/projectile/energy/floramut/gene/G = .
if(istype(G))
diff --git a/code/modules/projectiles/guns/launcher.dm b/code/modules/projectiles/guns/launcher.dm
index 8f9b97ef5835..7c9f03a79404 100644
--- a/code/modules/projectiles/guns/launcher.dm
+++ b/code/modules/projectiles/guns/launcher.dm
@@ -29,5 +29,5 @@
/**
* Returns the next /atom/movable to throw, or a GUN_FIRED_* for fail satus.
*/
-/obj/item/gun/launcher/proc/process_next_entity()
+/obj/item/gun/launcher/proc/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index a3755d1c22ef..f3f55f701440 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -81,7 +81,7 @@
return
return ..()
-/obj/item/gun/launcher/crossbow/process_next_entity()
+/obj/item/gun/launcher/crossbow/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return bolt
/obj/item/gun/launcher/crossbow/handle_post_fire(mob/user, atom/target)
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index 3bc72527a3ce..64900aecedc7 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -83,12 +83,12 @@
return
eject_tank(user)
-/obj/item/gun/launcher/pneumatic/process_next_entity()
+/obj/item/gun/launcher/pneumatic/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!item_storage.contents.len)
- return null
+ return GUN_FIRED_FAIL_EMPTY
if (!tank)
- to_chat(user, "There is no gas tank in [src]!")
- return null
+ actor?.chat_feedback(SPAN_WARNING("There's no gas tank in [src]!"), src)
+ return GUN_FIRED_FAIL_INERT
var/environment_pressure = 10
var/turf/T = get_turf(src)
@@ -99,8 +99,9 @@
fire_pressure = (tank.air_contents.return_pressure() - environment_pressure)*pressure_setting/100
if(fire_pressure < 10)
- to_chat(user, "There isn't enough gas in the tank to fire [src].")
- return null
+ // todo: ughhhh this should misfire not do this
+ actor?.chat_feedback(SPAN_WARNING("There's not enough gas in the tank to fire [src]!"), src)
+ return GUN_FIRED_FAIL_INERT
var/obj/item/launched = item_storage.contents[1]
item_storage.obj_storage.remove(launched, src)
diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm
index 45e94d9ba0c6..b9c6ab1cdad9 100644
--- a/code/modules/projectiles/guns/launcher/syringe_gun.dm
+++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm
@@ -84,7 +84,7 @@
var/max_darts = 1
var/obj/item/syringe_cartridge/next
-/obj/item/gun/launcher/syringe/process_next_entity()
+/obj/item/gun/launcher/syringe/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(next)
next.prime()
return next
diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm
index 49598513fd8f..b989a7b26dde 100644
--- a/code/modules/projectiles/guns/magic.dm
+++ b/code/modules/projectiles/guns/magic.dm
@@ -67,7 +67,7 @@
recharge_newshot()
return 1
-/obj/item/gun/magic/consume_next_projectile()
+/obj/item/gun/magic/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return chambered?.get_projectile()
/obj/item/gun/magic/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
diff --git a/code/modules/projectiles/guns/magnetic.dm b/code/modules/projectiles/guns/magnetic.dm
index 1b1551672128..89ff6758f504 100644
--- a/code/modules/projectiles/guns/magnetic.dm
+++ b/code/modules/projectiles/guns/magnetic.dm
@@ -165,7 +165,7 @@
qdel(loaded)
loaded = null
-/obj/item/gun/magnetic/process_next_projectile()
+/obj/item/gun/magnetic/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
@@ -206,7 +206,7 @@
capacitor = new /obj/item/stock_parts/capacitor
return ..()
-/obj/item/gun/magnetic/fuelrod/process_next_projectile()
+/obj/item/gun/magnetic/fuelrod/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
diff --git a/code/modules/projectiles/guns/vox.dm b/code/modules/projectiles/guns/vox.dm
index 6531d35bf41f..e3e6d71efb2c 100644
--- a/code/modules/projectiles/guns/vox.dm
+++ b/code/modules/projectiles/guns/vox.dm
@@ -46,7 +46,7 @@
/obj/item/gun/launcher/spikethrower/update_release_force()
return
-/obj/item/gun/launcher/spikethrower/process_next_entity()
+/obj/item/gun/launcher/spikethrower/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(spikes < 1) return null
spikes--
return new /obj/item/spike(src)
From a39faf3b6e0253fcca12e79e33a86035902e0eb7 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 15:42:33 +0000
Subject: [PATCH 34/68] modifications, push stuff around
---
citadel.dme | 25 +++++++++----------
code/__DEFINES/projectiles/gun_components.dm | 2 +-
code/modules/clothing/chameleon.dm | 2 +-
.../mining/tools/kinetic_accelerator.dm | 2 +-
.../projectiles/guns/ballistic/contender.dm | 4 +--
.../guns/ballistic/magnetic-modular.dm | 6 -----
code/modules/projectiles/guns/energy.dm | 11 ++++++--
.../projectiles/guns/energy/frontier.dm | 2 +-
.../projectiles/guns/energy/hooklauncher.dm | 2 +-
code/modules/projectiles/guns/energy/laser.dm | 11 ++++----
.../guns/energy/modular/gunframes.dm | 4 +--
.../guns/energy/modular_guns_old.dm | 2 +-
.../projectiles/guns/energy/nuclear.dm | 4 +--
.../projectiles/guns/energy/particle.dm | 4 +--
.../projectiles/guns/energy/sizegun_vr.dm | 4 +--
.../projectiles/guns/energy/special.dm | 12 ++++-----
.../guns/energy/special/hardlight_bow.dm | 2 +-
code/modules/projectiles/guns/energy/stun.dm | 2 +-
.../projectiles/{ => guns}/gun-firing.dm | 0
.../projectiles/{ => guns}/gun-modular.dm | 0
.../gun-projectile-implementation.dm | 6 ++++-
code/modules/projectiles/{ => guns}/gun.dm | 24 +++++++++++++++---
.../projectiles/{ => guns}/gun_component.dm | 0
.../gun_component}/acceleration_coil.dm | 0
.../gun_component}/active_cooler.dm | 0
.../gun_component}/energy_handler.dm | 0
.../gun_component}/internal_module.dm | 0
.../gun_component}/power_unit.dm | 0
.../{ => guns}/gun_item_renderer.dm | 0
.../{ => guns}/gun_mob_renderer.dm | 0
code/modules/projectiles/guns/launcher.dm | 3 ++-
.../guns/legacy_vr_guns/custom_guns.dm | 4 +--
code/modules/projectiles/guns/vox.dm | 4 +--
maps/templates/admin/ert_base.dmm | 8 +++---
34 files changed, 86 insertions(+), 64 deletions(-)
delete mode 100644 code/modules/projectiles/guns/ballistic/magnetic-modular.dm
rename code/modules/projectiles/{ => guns}/gun-firing.dm (100%)
rename code/modules/projectiles/{ => guns}/gun-modular.dm (100%)
rename code/modules/projectiles/{ => guns}/gun-projectile-implementation.dm (84%)
rename code/modules/projectiles/{ => guns}/gun.dm (96%)
rename code/modules/projectiles/{ => guns}/gun_component.dm (100%)
rename code/modules/projectiles/{gun_components => guns/gun_component}/acceleration_coil.dm (100%)
rename code/modules/projectiles/{gun_components => guns/gun_component}/active_cooler.dm (100%)
rename code/modules/projectiles/{gun_components => guns/gun_component}/energy_handler.dm (100%)
rename code/modules/projectiles/{gun_components => guns/gun_component}/internal_module.dm (100%)
rename code/modules/projectiles/{gun_components => guns/gun_component}/power_unit.dm (100%)
rename code/modules/projectiles/{ => guns}/gun_item_renderer.dm (100%)
rename code/modules/projectiles/{ => guns}/gun_mob_renderer.dm (100%)
diff --git a/citadel.dme b/citadel.dme
index 57da7a21c09a..b27ed037cb17 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4389,13 +4389,6 @@
#include "code\modules\preferences\preference_setup\vore\09_nif.dm"
#include "code\modules\preferences\preference_setup\vore\10_misc.dm"
#include "code\modules\projectiles\firing_pin.dm"
-#include "code\modules\projectiles\gun-firing.dm"
-#include "code\modules\projectiles\gun-modular.dm"
-#include "code\modules\projectiles\gun-projectile-implementation.dm"
-#include "code\modules\projectiles\gun.dm"
-#include "code\modules\projectiles\gun_component.dm"
-#include "code\modules\projectiles\gun_item_renderer.dm"
-#include "code\modules\projectiles\gun_mob_renderer.dm"
#include "code\modules\projectiles\ammunition\ammo_caliber.dm"
#include "code\modules\projectiles\ammunition\ammo_casing.dm"
#include "code\modules\projectiles\ammunition\ammo_magazine.dm"
@@ -4426,13 +4419,15 @@
#include "code\modules\projectiles\ammunition\calibers\special\musket.dm"
#include "code\modules\projectiles\ammunition\calibers\special\pellet.dm"
#include "code\modules\projectiles\ammunition\calibers\special\rocket.dm"
-#include "code\modules\projectiles\gun_components\acceleration_coil.dm"
-#include "code\modules\projectiles\gun_components\active_cooler.dm"
-#include "code\modules\projectiles\gun_components\energy_handler.dm"
-#include "code\modules\projectiles\gun_components\internal_module.dm"
-#include "code\modules\projectiles\gun_components\power_unit.dm"
#include "code\modules\projectiles\guns\ballistic.dm"
#include "code\modules\projectiles\guns\energy.dm"
+#include "code\modules\projectiles\guns\gun-firing.dm"
+#include "code\modules\projectiles\guns\gun-modular.dm"
+#include "code\modules\projectiles\guns\gun-projectile-implementation.dm"
+#include "code\modules\projectiles\guns\gun.dm"
+#include "code\modules\projectiles\guns\gun_component.dm"
+#include "code\modules\projectiles\guns\gun_item_renderer.dm"
+#include "code\modules\projectiles\guns\gun_mob_renderer.dm"
#include "code\modules\projectiles\guns\launcher.dm"
#include "code\modules\projectiles\guns\magic.dm"
#include "code\modules\projectiles\guns\magnetic.dm"
@@ -4443,7 +4438,6 @@
#include "code\modules\projectiles\guns\ballistic\caseless.dm"
#include "code\modules\projectiles\guns\ballistic\contender.dm"
#include "code\modules\projectiles\guns\ballistic\dartgun.dm"
-#include "code\modules\projectiles\guns\ballistic\magnetic-modular.dm"
#include "code\modules\projectiles\guns\ballistic\magnetic.dm"
#include "code\modules\projectiles\guns\ballistic\musket.dm"
#include "code\modules\projectiles\guns\ballistic\pistol.dm"
@@ -4480,6 +4474,11 @@
#include "code\modules\projectiles\guns\energy\modular\modularlenses.dm"
#include "code\modules\projectiles\guns\energy\modular\modularpower.dm"
#include "code\modules\projectiles\guns\energy\special\hardlight_bow.dm"
+#include "code\modules\projectiles\guns\gun_component\acceleration_coil.dm"
+#include "code\modules\projectiles\guns\gun_component\active_cooler.dm"
+#include "code\modules\projectiles\guns\gun_component\energy_handler.dm"
+#include "code\modules\projectiles\guns\gun_component\internal_module.dm"
+#include "code\modules\projectiles\guns\gun_component\power_unit.dm"
#include "code\modules\projectiles\guns\launcher\crossbow.dm"
#include "code\modules\projectiles\guns\launcher\grenade_launcher.dm"
#include "code\modules\projectiles\guns\launcher\pneumatic.dm"
diff --git a/code/__DEFINES/projectiles/gun_components.dm b/code/__DEFINES/projectiles/gun_components.dm
index 3134e8774bca..9730333f5ec3 100644
--- a/code/__DEFINES/projectiles/gun_components.dm
+++ b/code/__DEFINES/projectiles/gun_components.dm
@@ -37,7 +37,7 @@
/// component used for accelerating the projectile.
#define GUN_COMPONENT_ACCELERATION_COIL "magnetic-coil"
-//* - generally energy - *//
+//* - generally particle (energy) - *//
/// component used to (re)-focus the energy beam being emit
#define GUN_COMPONENT_FOCUSING_LENS "focusing-lens"
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index 4cd9dc5cd10b..b1e64af2f878 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -366,7 +366,7 @@
projectile_type = /obj/projectile/chameleon
charge_meter = 0
charge_cost = 48 //uses next to no power, since it's just holograms
- battery_lock = 1
+ legacy_battery_lock = 1
var/obj/projectile/copy_projectile
var/global/list/gun_choices
diff --git a/code/modules/mining/tools/kinetic_accelerator.dm b/code/modules/mining/tools/kinetic_accelerator.dm
index 0f27bded9b6b..d1ffc88325c8 100644
--- a/code/modules/mining/tools/kinetic_accelerator.dm
+++ b/code/modules/mining/tools/kinetic_accelerator.dm
@@ -26,7 +26,7 @@
projectile_type = /obj/projectile/kinetic
charge_cost = 1200
- battery_lock = TRUE
+ legacy_battery_lock = TRUE
fire_sound = 'sound/weapons/kenetic_accel.ogg'
render_use_legacy_by_default = FALSE
var/overheat_time = 16
diff --git a/code/modules/projectiles/guns/ballistic/contender.dm b/code/modules/projectiles/guns/ballistic/contender.dm
index 721c02ee0be4..56aedf1287a0 100644
--- a/code/modules/projectiles/guns/ballistic/contender.dm
+++ b/code/modules/projectiles/guns/ballistic/contender.dm
@@ -118,9 +118,7 @@
explosion(get_turf(src), -1, 0, 2, 3)
if(destroyed)
- to_chat(user, "The [src] is broken!")
- handle_click_empty()
- return
+ return GUN_FIRED_FAIL_INERT
/obj/item/gun/ballistic/contender/pipegun/Fire(atom/target, mob/living/user, clickparams, pointblank, reflex)
. = ..()
diff --git a/code/modules/projectiles/guns/ballistic/magnetic-modular.dm b/code/modules/projectiles/guns/ballistic/magnetic-modular.dm
deleted file mode 100644
index 6627a47947b1..000000000000
--- a/code/modules/projectiles/guns/ballistic/magnetic-modular.dm
+++ /dev/null
@@ -1,6 +0,0 @@
-//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 Citadel Station Developers *//
-
-/obj/item/gun/ballistic/magnetic/modular
-
-#warn impl all
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 4bf97609db74..46f6dfc64d45 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -31,8 +31,7 @@
var/charge_tick = 0
var/charge_delay = 75 //delay between firing and charging
- var/battery_lock = 0 //If set, weapon cannot switch batteries
- #warn dela with this
+ var/legacy_battery_lock = 0 //If set, weapon cannot switch batteries
/obj/item/gun/energy/Initialize(mapload)
if(self_recharge)
@@ -177,3 +176,11 @@
if(!cell)
return 0
return cell.charge / cell.maxcharge
+
+
+//* Power *//
+
+/obj/item/gun/energy/object_cell_slot_mutable(mob/user, datum/object_system/cell_slot/slot)
+ if(legacy_battery_lock)
+ return FALSE
+ return ..()
diff --git a/code/modules/projectiles/guns/energy/frontier.dm b/code/modules/projectiles/guns/energy/frontier.dm
index c0e2c28604a0..2aba67b663a1 100644
--- a/code/modules/projectiles/guns/energy/frontier.dm
+++ b/code/modules/projectiles/guns/energy/frontier.dm
@@ -8,7 +8,7 @@
fire_sound = 'sound/weapons/laser_rifle_1.wav'
origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 2, TECH_POWER = 4)
charge_cost = 300
- battery_lock = 1
+ legacy_battery_lock = 1
var/recharging = 0
var/phase_power = 75
diff --git a/code/modules/projectiles/guns/energy/hooklauncher.dm b/code/modules/projectiles/guns/energy/hooklauncher.dm
index e9ee3d4e4bc1..3cb0f23ff337 100644
--- a/code/modules/projectiles/guns/energy/hooklauncher.dm
+++ b/code/modules/projectiles/guns/energy/hooklauncher.dm
@@ -27,7 +27,7 @@
w_class = WEIGHT_CLASS_TINY
cell_type = /obj/item/cell/device/weapon/recharge/alien
- battery_lock = TRUE
+ legacy_battery_lock = TRUE
charge_cost = 400
charge_meter = FALSE
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index e3d6d0a47639..42748084733f 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -123,7 +123,7 @@
fire_delay = 10 //Old pistol
charge_cost = 480 //to compensate a bit for self-recharging
cell_type = /obj/item/cell/device/weapon/recharge/captain
- battery_lock = 1
+ legacy_battery_lock = 1
/obj/item/gun/energy/lasercannon
name = "laser cannon"
@@ -133,7 +133,7 @@
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 3, TECH_POWER = 3)
slot_flags = SLOT_BELT|SLOT_BACK
projectile_type = /obj/projectile/beam/heavylaser/cannon
- battery_lock = 1
+ legacy_battery_lock = 1
fire_delay = 20
w_class = WEIGHT_CLASS_BULKY
heavy = TRUE
@@ -203,7 +203,7 @@
pin = /obj/item/firing_pin/explorer
cell_type = /obj/item/cell/device/weapon/recharge/sniper
accuracy = 45 //Modifications include slightly better hip-firing furniture.
- battery_lock = 1 //With the change that the normal DMR can now change the weapon cell, we need to add this here so people can't take out the self-recharging special cell.
+ legacy_battery_lock = 1 //With the change that the normal DMR can now change the weapon cell, we need to add this here so people can't take out the self-recharging special cell.
scoped_accuracy = 100
charge_cost = 600
@@ -254,7 +254,7 @@
materials_base = list(MAT_STEEL = 2000)
projectile_type = /obj/projectile/beam/lasertag/blue
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
/obj/item/gun/energy/lasertag/blue
icon_state = "bluetag"
@@ -321,7 +321,8 @@
if(.)
if(unstable)
if(prob(10))
- to_chat(user, "The cell overcooks and ruptures!")
+ // todo: actor support if we keep this shit
+ visible_message("The cell overcooks and ruptures!")
spawn(rand(2 SECONDS,5 SECONDS))
if(!QDELETED(src))
visible_message("\The [src] detonates!")
diff --git a/code/modules/projectiles/guns/energy/modular/gunframes.dm b/code/modules/projectiles/guns/energy/modular/gunframes.dm
index 8fb9c34a61f8..43a4f3c66621 100644
--- a/code/modules/projectiles/guns/energy/modular/gunframes.dm
+++ b/code/modules/projectiles/guns/energy/modular/gunframes.dm
@@ -58,7 +58,7 @@
name = "modular energy cannon"
desc = "A huge, semi-modular energy cannon. Can mount three cores, and utilizes a robust power handler and circuitry combined with an integral large cell."
cores = 3
- battery_lock = TRUE
+ legacy_battery_lock = TRUE
cell_type = /obj/item/cell/device/weapon/modcannon
icon_state = "mod_cannon"
w_class = WEIGHT_CLASS_HUGE
@@ -77,7 +77,7 @@
name = "advanced modular energy gun"
desc = "A huge, semi-modular energy weapon. Can mount two cores, and utilizes an advanced power handler coupled with an integral RTG."
cores = 2
- battery_lock = TRUE
+ legacy_battery_lock = TRUE
cell_type = /obj/item/cell/device/weapon/recharge/captain
icon_state = "modnuc"
w_class = WEIGHT_CLASS_HUGE
diff --git a/code/modules/projectiles/guns/energy/modular_guns_old.dm b/code/modules/projectiles/guns/energy/modular_guns_old.dm
index 7e226f09e813..2835fbf39069 100644
--- a/code/modules/projectiles/guns/energy/modular_guns_old.dm
+++ b/code/modules/projectiles/guns/energy/modular_guns_old.dm
@@ -129,7 +129,7 @@
/obj/item/gun/energy/modular/load_ammo(var/obj/item/C, mob/user)
if(istype(C, cell_type))
- if(self_recharge || battery_lock)
+ if(self_recharge || legacy_battery_lock)
to_chat(user, "[src] does not have a battery port.")
return
var/obj/item/cell/P = C
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index f901aac01cbb..2f90889fc630 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -81,7 +81,7 @@
heavy = TRUE
fire_delay = 6 //This one's not a handgun, it should have the same fire delay as everything else
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
modifystate = null
// requires_two_hands = 1
@@ -107,7 +107,7 @@
damage_force = 10 //for the HOS to lay down a good beating in desperate situations. Holdover from TG.
w_class = WEIGHT_CLASS_NORMAL
fire_delay = 6 //standard rate
- battery_lock = 0
+ legacy_battery_lock = 0
modifystate = null
firemodes = list(
diff --git a/code/modules/projectiles/guns/energy/particle.dm b/code/modules/projectiles/guns/energy/particle.dm
index 0013b80026cb..0c541ecdb30f 100644
--- a/code/modules/projectiles/guns/energy/particle.dm
+++ b/code/modules/projectiles/guns/energy/particle.dm
@@ -37,7 +37,7 @@
fire_delay = 6 //This one's not a handgun, it should have the same fire delay as everything else
self_recharge = 1
modifystate = null
- battery_lock = 1
+ legacy_battery_lock = 1
recharge_time = 6 // every 6 ticks, recharge 2 shots. Slightly slower than AEG.
charge_delay = 10 //Starts recharging faster after firing than an AEG though.
one_handed_penalty = 15
@@ -51,7 +51,7 @@
slot_flags = SLOT_BACK
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 5, TECH_POWER = 4, TECH_MAGNET = 4)
projectile_type = /obj/projectile/bullet/particle/heavy
- battery_lock = 1
+ legacy_battery_lock = 1
fire_delay = 15 // fires faster than a laser cannon. c'mon, it's an awesome-but-impractical endgame gun.
w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack.
damage_force = 10
diff --git a/code/modules/projectiles/guns/energy/sizegun_vr.dm b/code/modules/projectiles/guns/energy/sizegun_vr.dm
index dc84fa265130..0e1f680224ce 100644
--- a/code/modules/projectiles/guns/energy/sizegun_vr.dm
+++ b/code/modules/projectiles/guns/energy/sizegun_vr.dm
@@ -14,7 +14,7 @@
origin_tech = list(TECH_BLUESPACE = 4)
modifystate = "sizegun-shrink"
no_pin_required = 1
- battery_lock = 1
+ legacy_battery_lock = 1
var/size_set_to = 1
firemodes = list(
list(mode_name = "select size",
@@ -110,5 +110,5 @@
origin_tech = list(TECH_BLUESPACE = 4)
modifystate = "sizegun-shrink"
no_pin_required = 1
- battery_lock = 1
+ legacy_battery_lock = 1
firemodes = list()
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 20b4174bce68..2a6e5d42c315 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -46,7 +46,7 @@
modifystate = "floramut"
cell_type = /obj/item/cell/device/weapon/recharge
no_pin_required = 1
- battery_lock = 1
+ legacy_battery_lock = 1
var/singleton/plantgene/gene = null
firemodes = list(
@@ -140,7 +140,7 @@
projectile_type = /obj/projectile/change
origin_tech = null
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
charge_meter = 0
/obj/item/gun/energy/staff/special_check(var/mob/user)
@@ -193,7 +193,7 @@
charge_cost = 24 // 100 shots, it's a spray and pray (to RNGesus) weapon.
projectile_type = /obj/projectile/energy/blue_pellet
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
accuracy = 75 // Suppressive weapons don't work too well if there's no risk of being hit.
burst_delay = 1 // Burst faster than average.
origin_tech = list(TECH_COMBAT = 6, TECH_MAGNET = 6, TECH_ILLEGAL = 6)
@@ -331,7 +331,7 @@
fire_delay = 10 //Old pistol
charge_cost = 480 //to compensate a bit for self-recharging
cell_type = /obj/item/cell/device/weapon/recharge/captain
- battery_lock = 1
+ legacy_battery_lock = 1
one_handed_penalty = 0
safety_state = GUN_SAFETY_OFF
@@ -417,7 +417,7 @@
fire_delay = 10
charge_cost = 800
cell_type = /obj/item/cell/device/weapon/recharge/captain
- battery_lock = 1
+ legacy_battery_lock = 1
one_handed_penalty = 0
/obj/item/gun/energy/ermitter
@@ -454,7 +454,7 @@
fire_delay = 20
charge_cost = 600
cell_type = /obj/item/cell/device/weapon
- battery_lock = 1
+ legacy_battery_lock = 1
slot_flags = SLOT_BACK
w_class = WEIGHT_CLASS_BULKY
heavy = TRUE
diff --git a/code/modules/projectiles/guns/energy/special/hardlight_bow.dm b/code/modules/projectiles/guns/energy/special/hardlight_bow.dm
index 05e7dc94cd63..496bf3f4b2f8 100644
--- a/code/modules/projectiles/guns/energy/special/hardlight_bow.dm
+++ b/code/modules/projectiles/guns/energy/special/hardlight_bow.dm
@@ -7,7 +7,7 @@
item_state = "bow_pipe"
slot_flags = SLOT_BACK | SLOT_BELT
charge_cost = 1200
- battery_lock = 1
+ legacy_battery_lock = 1
pin = /obj/item/firing_pin/explorer
projectile_type = /obj/projectile/ion
diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm
index 347b32ad1c95..f35c1e3cc4c1 100644
--- a/code/modules/projectiles/guns/energy/stun.dm
+++ b/code/modules/projectiles/guns/energy/stun.dm
@@ -60,7 +60,7 @@
projectile_type = /obj/projectile/energy/bolt
charge_cost = 480
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
charge_meter = 0
/obj/item/gun/energy/crossbow/ninja
diff --git a/code/modules/projectiles/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
similarity index 100%
rename from code/modules/projectiles/gun-firing.dm
rename to code/modules/projectiles/guns/gun-firing.dm
diff --git a/code/modules/projectiles/gun-modular.dm b/code/modules/projectiles/guns/gun-modular.dm
similarity index 100%
rename from code/modules/projectiles/gun-modular.dm
rename to code/modules/projectiles/guns/gun-modular.dm
diff --git a/code/modules/projectiles/gun-projectile-implementation.dm b/code/modules/projectiles/guns/gun-projectile-implementation.dm
similarity index 84%
rename from code/modules/projectiles/gun-projectile-implementation.dm
rename to code/modules/projectiles/guns/gun-projectile-implementation.dm
index 7aa8648c5d53..8fcab36612ef 100644
--- a/code/modules/projectiles/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/guns/gun-projectile-implementation.dm
@@ -10,6 +10,8 @@
* this way we have separation between behaviors only needed on guns that shoot
* /obj/projectile's. that said, this is a little annoying to do (path length bloat)
* so for now we put the projectile procs in their own file.
+ *
+ * maybe we won't do it after all due to path length bloat but the current method definitely just sucks.
*/
/**
@@ -30,4 +32,6 @@
* * firer - (optional) the actual firer.
*/
/obj/item/gun/proc/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
- #warn impl
+ . = GUN_FIRED_FAIL_UNKNOWN
+ // todo: on base /gun/projectile?
+ CRASH("attempted to process next projectile on base /gun")
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/guns/gun.dm
similarity index 96%
rename from code/modules/projectiles/gun.dm
rename to code/modules/projectiles/guns/gun.dm
index 6d2434319781..7c60bdc3e26f 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -163,6 +163,11 @@
///
/// * This is a lazy list.
var/list/obj/item/gun_component/modular_components
+ /// lazy way to set internal slots, because this is modified so often
+ ///
+ /// * literally not checked past init, it's used to generate the typelist
+ /// * if it's specified in the list, the list's copy is used instead.
+ var/modular_component_slots_internal = INFINITY
/// allowed component slots, associated to amount
///
/// * this is typelist()'d; if you want to change it later, make a copy!
@@ -224,7 +229,7 @@
/obj/item/gun/Initialize(mapload)
. = ..()
- // instantiate & dedupe renderers
+ // instantiate & dedupe renderers //
var/requires_icon_update
if(item_renderer)
if(ispath(item_renderer) || IS_ANONYMOUS_TYPEPATH(item_renderer))
@@ -241,7 +246,9 @@
if(requires_icon_update)
update_icon()
- //! LEGACY: if neither of these are here, we are using legacy render.
+ //! LEGACY BELOW !//
+
+ // if neither of these are here, we are using legacy render. //
if(!item_renderer && !mob_renderer && render_use_legacy_by_default)
item_icons = list(
SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_guns.dmi',
@@ -266,13 +273,24 @@
if(pin)
pin = new pin(src)
- // cell system
+ //! LEGACY ABOVE !//
+
+ // cell system //
if(cell_system)
var/datum/object_system/cell_slot/slot = init_cell_slot(cell_type)
slot.legacy_use_device_cells = cell_system_legacy_use_device
slot.remove_yank_offhand = TRUE
slot.remove_yank_context = TRUE
+ // modular components //
+ if(islist(modular_component_slots) && !(modular_component_slots = get_typelist(NAMEOF(src, modular_component_slots))))
+ // if it's 1. a list and 2. we can't grab a typelist for it,
+ // we make it, patching internal modules lazily
+ var/internal_modules_patch = modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE]
+ if(isnull(internal_modules_patch))
+ modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE] = modular_component_slots_internal
+ modular_component_slots = typelist(NAMEOF(src, modular_component_slots), modular_component_slots)
+
/obj/item/gun/examine(mob/user, dist)
. = ..()
if(!no_pin_required)
diff --git a/code/modules/projectiles/gun_component.dm b/code/modules/projectiles/guns/gun_component.dm
similarity index 100%
rename from code/modules/projectiles/gun_component.dm
rename to code/modules/projectiles/guns/gun_component.dm
diff --git a/code/modules/projectiles/gun_components/acceleration_coil.dm b/code/modules/projectiles/guns/gun_component/acceleration_coil.dm
similarity index 100%
rename from code/modules/projectiles/gun_components/acceleration_coil.dm
rename to code/modules/projectiles/guns/gun_component/acceleration_coil.dm
diff --git a/code/modules/projectiles/gun_components/active_cooler.dm b/code/modules/projectiles/guns/gun_component/active_cooler.dm
similarity index 100%
rename from code/modules/projectiles/gun_components/active_cooler.dm
rename to code/modules/projectiles/guns/gun_component/active_cooler.dm
diff --git a/code/modules/projectiles/gun_components/energy_handler.dm b/code/modules/projectiles/guns/gun_component/energy_handler.dm
similarity index 100%
rename from code/modules/projectiles/gun_components/energy_handler.dm
rename to code/modules/projectiles/guns/gun_component/energy_handler.dm
diff --git a/code/modules/projectiles/gun_components/internal_module.dm b/code/modules/projectiles/guns/gun_component/internal_module.dm
similarity index 100%
rename from code/modules/projectiles/gun_components/internal_module.dm
rename to code/modules/projectiles/guns/gun_component/internal_module.dm
diff --git a/code/modules/projectiles/gun_components/power_unit.dm b/code/modules/projectiles/guns/gun_component/power_unit.dm
similarity index 100%
rename from code/modules/projectiles/gun_components/power_unit.dm
rename to code/modules/projectiles/guns/gun_component/power_unit.dm
diff --git a/code/modules/projectiles/gun_item_renderer.dm b/code/modules/projectiles/guns/gun_item_renderer.dm
similarity index 100%
rename from code/modules/projectiles/gun_item_renderer.dm
rename to code/modules/projectiles/guns/gun_item_renderer.dm
diff --git a/code/modules/projectiles/gun_mob_renderer.dm b/code/modules/projectiles/guns/gun_mob_renderer.dm
similarity index 100%
rename from code/modules/projectiles/gun_mob_renderer.dm
rename to code/modules/projectiles/guns/gun_mob_renderer.dm
diff --git a/code/modules/projectiles/guns/launcher.dm b/code/modules/projectiles/guns/launcher.dm
index 7c9f03a79404..060665b74fba 100644
--- a/code/modules/projectiles/guns/launcher.dm
+++ b/code/modules/projectiles/guns/launcher.dm
@@ -30,4 +30,5 @@
* Returns the next /atom/movable to throw, or a GUN_FIRED_* for fail satus.
*/
/obj/item/gun/launcher/proc/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
- return
+ . = GUN_FIRED_FAIL_UNKNOWN
+ CRASH("attempted to process_next_entity on base /gun/launcher")
diff --git a/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm b/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
index a07897a1a390..ee5e2385cde9 100644
--- a/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
+++ b/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
@@ -116,7 +116,7 @@
icon_state = "elugerstun100"
item_state = "gun"
fire_delay = null // Lugers are quite comfortable to shoot, thus allowing for more controlled follow-up shots. Rate of fire similar to a laser carbine.
- battery_lock = 1 // In exchange for balance, you cannot remove the battery. Also there's no sprite for that and I fucking suck at sprites. -Ace
+ legacy_battery_lock = 1 // In exchange for balance, you cannot remove the battery. Also there's no sprite for that and I fucking suck at sprites. -Ace
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2, TECH_ILLEGAL = 2)
modifystate = "elugerstun"
fire_sound = 'sound/weapons/Taser.ogg'
@@ -225,7 +225,7 @@
charge_cost = 1200
charge_meter = 0
modifystate = null
- battery_lock = 1
+ legacy_battery_lock = 1
fire_sound = 'sound/weapons/Taser.ogg'
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2)
firemodes = list(
diff --git a/code/modules/projectiles/guns/vox.dm b/code/modules/projectiles/guns/vox.dm
index e3e6d71efb2c..004948e0175d 100644
--- a/code/modules/projectiles/guns/vox.dm
+++ b/code/modules/projectiles/guns/vox.dm
@@ -64,7 +64,7 @@
charge_cost = 300
projectile_type = /obj/projectile/beam/stun/darkmatter
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
accuracy = 30
firemodes = list(
@@ -126,7 +126,7 @@
w_class = WEIGHT_CLASS_HUGE
heavy = TRUE
cell_type = /obj/item/cell/device/weapon/recharge
- battery_lock = 1
+ legacy_battery_lock = 1
charge_cost = 400
projectile_type=/obj/projectile/sonic/weak
diff --git a/maps/templates/admin/ert_base.dmm b/maps/templates/admin/ert_base.dmm
index b82c3d08903c..118c5807975c 100644
--- a/maps/templates/admin/ert_base.dmm
+++ b/maps/templates/admin/ert_base.dmm
@@ -432,16 +432,16 @@
/obj/item/gun/energy/netgun,
/obj/item/gun/energy/sniperrifle,
/obj/item/gun/energy/gun/martin{
- battery_lock = 0
+ legacy_battery_lock = 0
},
/obj/item/gun/energy/gun/martin{
- battery_lock = 0
+ legacy_battery_lock = 0
},
/obj/item/gun/energy/gun/martin{
- battery_lock = 0
+ legacy_battery_lock = 0
},
/obj/item/gun/energy/gun/martin{
- battery_lock = 0
+ legacy_battery_lock = 0
},
/obj/item/cell/device/weapon,
/obj/item/cell/device/weapon,
From a20980451afc7f4c84a3b52d8bf1c7592b8f15b7 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 15:47:45 +0000
Subject: [PATCH 35/68] that
---
citadel.dme | 1 +
.../mining/tools/kinetic_accelerator.dm | 4 ++--
code/modules/projectiles/ammunition/README.md | 4 ++++
.../projectiles/ammunition/ammo_handful.dm | 18 ++++++++++++++++++
code/modules/projectiles/guns/gun.dm | 1 +
5 files changed, 26 insertions(+), 2 deletions(-)
create mode 100644 code/modules/projectiles/ammunition/README.md
create mode 100644 code/modules/projectiles/ammunition/ammo_handful.dm
diff --git a/citadel.dme b/citadel.dme
index b27ed037cb17..638b9bf4201a 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4391,6 +4391,7 @@
#include "code\modules\projectiles\firing_pin.dm"
#include "code\modules\projectiles\ammunition\ammo_caliber.dm"
#include "code\modules\projectiles\ammunition\ammo_casing.dm"
+#include "code\modules\projectiles\ammunition\ammo_handful.dm"
#include "code\modules\projectiles\ammunition\ammo_magazine.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a10g.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a10mm.dm"
diff --git a/code/modules/mining/tools/kinetic_accelerator.dm b/code/modules/mining/tools/kinetic_accelerator.dm
index d1ffc88325c8..6370d11503a5 100644
--- a/code/modules/mining/tools/kinetic_accelerator.dm
+++ b/code/modules/mining/tools/kinetic_accelerator.dm
@@ -40,9 +40,9 @@
var/recharge_timerid
-/obj/item/gun/energy/kinetic_accelerator/consume_next_projectile()
+/obj/item/gun/energy/kinetic_accelerator/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(overheat)
- return
+ return GUN_FIRED_FAIL_EMPTY
. = ..()
if(.)
var/obj/projectile/P = .
diff --git a/code/modules/projectiles/ammunition/README.md b/code/modules/projectiles/ammunition/README.md
new file mode 100644
index 000000000000..832c30ffdbe2
--- /dev/null
+++ b/code/modules/projectiles/ammunition/README.md
@@ -0,0 +1,4 @@
+# Ammunition
+
+Ammo system, including calibers, casings, and magazines are here.
+
diff --git a/code/modules/projectiles/ammunition/ammo_handful.dm b/code/modules/projectiles/ammunition/ammo_handful.dm
new file mode 100644
index 000000000000..9f060b4aa25c
--- /dev/null
+++ b/code/modules/projectiles/ammunition/ammo_handful.dm
@@ -0,0 +1,18 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/**
+ * TODO: Marker file.
+ *
+ * We will eventually want an /obj/item/ammo_handful type to achieve feature
+ * parity with combat servers like Colonial Marines.
+ *
+ * This is to make moving rounds around a bit easier.
+ * We will potentially lose the behavior of being able to move single rounds.
+ *
+ * There is, however, a way to get around this.
+ * We can have individual casings be dispensed on something like alt-click,
+ * so if you really want you can still do mix-and-match style;
+ * we do not have enough casings laying around in game that it's a major performance concern
+ * to allow people to just take them all out now and then.
+ */
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 7c60bdc3e26f..5c296a379f35 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -667,6 +667,7 @@
//called after successfully firing
/obj/item/gun/proc/handle_post_fire(mob/user, atom/target, var/pointblank=0, var/reflex=0)
+ SHOULD_NOT_OVERRIDE(TRUE)
if(fire_anim)
flick(fire_anim, src)
From f3db59663c8719829a5e2a4bd4a6213035088f01 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 15:49:44 +0000
Subject: [PATCH 36/68] get rid of unticked file and move another
---
citadel.dme | 2 +-
code/modules/projectiles/effects.dm | 288 ------------------
.../projectiles/{ => guns}/firing_pin.dm | 0
3 files changed, 1 insertion(+), 289 deletions(-)
delete mode 100644 code/modules/projectiles/effects.dm
rename code/modules/projectiles/{ => guns}/firing_pin.dm (100%)
diff --git a/citadel.dme b/citadel.dme
index 638b9bf4201a..940185418281 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4388,7 +4388,6 @@
#include "code\modules\preferences\preference_setup\vore\08_traits.dm"
#include "code\modules\preferences\preference_setup\vore\09_nif.dm"
#include "code\modules\preferences\preference_setup\vore\10_misc.dm"
-#include "code\modules\projectiles\firing_pin.dm"
#include "code\modules\projectiles\ammunition\ammo_caliber.dm"
#include "code\modules\projectiles\ammunition\ammo_casing.dm"
#include "code\modules\projectiles\ammunition\ammo_handful.dm"
@@ -4422,6 +4421,7 @@
#include "code\modules\projectiles\ammunition\calibers\special\rocket.dm"
#include "code\modules\projectiles\guns\ballistic.dm"
#include "code\modules\projectiles\guns\energy.dm"
+#include "code\modules\projectiles\guns\firing_pin.dm"
#include "code\modules\projectiles\guns\gun-firing.dm"
#include "code\modules\projectiles\guns\gun-modular.dm"
#include "code\modules\projectiles\guns\gun-projectile-implementation.dm"
diff --git a/code/modules/projectiles/effects.dm b/code/modules/projectiles/effects.dm
deleted file mode 100644
index 8ecd0c6ae682..000000000000
--- a/code/modules/projectiles/effects.dm
+++ /dev/null
@@ -1,288 +0,0 @@
-/obj/effect/projectile
- icon = 'icons/effects/projectiles.dmi'
- icon_state = "bolt"
- plane = ABOVE_PLANE
- mouse_opacity = 0
-
-/obj/effect/projectile/proc/set_transform(var/matrix/M)
- if(istype(M))
- transform = M
-
-/obj/effect/projectile/proc/activate(var/kill_delay = 5)
- update_light()
- spawn(kill_delay)
- qdel(src) //see effect_system.dm - sets loc to null and lets GC handle removing these effects
-
- return
-
-//----------------------------
-// Laser beam
-//----------------------------
-/obj/effect/projectile/laser/tracer
- icon_state = "beam"
- light_range = 2
- light_power = 0.5
- light_color = "#FF0D00"
-
-/obj/effect/projectile/laser/muzzle
- icon_state = "muzzle_laser"
- light_range = 2
- light_power = 0.5
- light_color = "#FF0D00"
-
-/obj/effect/projectile/laser/impact
- icon_state = "impact_laser"
- light_range = 2
- light_power = 0.5
- light_color = "#FF0D00"
-
-//----------------------------
-// Blue laser beam
-//----------------------------
-/obj/effect/projectile/laser_blue/tracer
- icon_state = "beam_blue"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-/obj/effect/projectile/laser_blue/muzzle
- icon_state = "muzzle_blue"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-/obj/effect/projectile/laser_blue/impact
- icon_state = "impact_blue"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-//----------------------------
-// Omni laser beam
-//----------------------------
-/obj/effect/projectile/laser_omni/tracer
- icon_state = "beam_omni"
- light_range = 2
- light_power = 0.5
- light_color = "#00C6FF"
-
-/obj/effect/projectile/laser_omni/muzzle
- icon_state = "muzzle_omni"
- light_range = 2
- light_power = 0.5
- light_color = "#00C6FF"
-
-/obj/effect/projectile/laser_omni/impact
- icon_state = "impact_omni"
- light_range = 2
- light_power = 0.5
- light_color = "#00C6FF"
-
-//----------------------------
-// Xray laser beam
-//----------------------------
-/obj/effect/projectile/xray/tracer
- icon_state = "xray"
- light_range = 2
- light_power = 0.5
- light_color = "#00CC33"
-
-/obj/effect/projectile/xray/muzzle
- icon_state = "muzzle_xray"
- light_range = 2
- light_power = 0.5
- light_color = "#00CC33"
-
-/obj/effect/projectile/xray/impact
- icon_state = "impact_xray"
- light_range = 2
- light_power = 0.5
- light_color = "#00CC33"
-
-//----------------------------
-// Heavy laser beam
-//----------------------------
-/obj/effect/projectile/laser_heavy/tracer
- icon_state = "beam_heavy"
- light_range = 3
- light_power = 1
- light_color = "#FF0D00"
-
-/obj/effect/projectile/laser_heavy/muzzle
- icon_state = "muzzle_beam_heavy"
- light_range = 3
- light_power = 1
- light_color = "#FF0D00"
-
-/obj/effect/projectile/laser_heavy/impact
- icon_state = "impact_beam_heavy"
- light_range = 3
- light_power = 1
- light_color = "#FF0D00"
-
-//----------------------------
-// Pulse laser beam
-//----------------------------
-/obj/effect/projectile/laser_pulse/tracer
- icon_state = "u_laser"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-/obj/effect/projectile/laser_pulse/muzzle
- icon_state = "muzzle_u_laser"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-/obj/effect/projectile/laser_pulse/impact
- icon_state = "impact_u_laser"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-//----------------------------
-// Pulse muzzle effect only
-//----------------------------
-/obj/effect/projectile/pulse/muzzle
- icon_state = "muzzle_pulse"
- light_range = 2
- light_power = 0.5
- light_color = "#0066FF"
-
-//----------------------------
-// Emitter beam
-//----------------------------
-/obj/effect/projectile/emitter/tracer
- icon_state = "emitter"
- light_range = 2
- light_power = 0.5
- light_color = "#00CC33"
-
-/obj/effect/projectile/emitter/muzzle
- icon_state = "muzzle_emitter"
- light_range = 2
- light_power = 0.5
- light_color = "#00CC33"
-
-/obj/effect/projectile/emitter/impact
- icon_state = "impact_emitter"
- light_range = 2
- light_power = 0.5
- light_color = "#00CC33"
-
-//----------------------------
-// Stun beam
-//----------------------------
-/obj/effect/projectile/stun/tracer
- icon_state = "stun"
- light_range = 2
- light_power = 0.5
- light_color = "#FFFFFF"
-
-/obj/effect/projectile/stun/muzzle
- icon_state = "muzzle_stun"
- light_range = 2
- light_power = 0.5
- light_color = "#FFFFFF"
-
-/obj/effect/projectile/stun/impact
- icon_state = "impact_stun"
- light_range = 2
- light_power = 0.5
- light_color = "#FFFFFF"
-
-//----------------------------
-// Bullet
-//----------------------------
-/obj/effect/projectile/bullet/muzzle
- icon_state = "muzzle_bullet"
- light_range = 2
- light_power = 0.5
- light_color = "#FFFFFF"
-
-//----------------------------
-// Lightning beam
-//----------------------------
-/obj/effect/projectile/lightning/tracer
- icon_state = "lightning"
- light_range = 2
- light_power = 0.5
- light_color = "#00C6FF"
-
-/obj/effect/projectile/lightning/muzzle
- icon_state = "muzzle_lightning"
- light_range = 2
- light_power = 0.5
- light_color = "#00C6FF"
-
-/obj/effect/projectile/lightning/impact
- icon_state = "impact_lightning"
- light_range = 2
- light_power = 0.5
- light_color = "#00C6FF"
-
-//----------------------------
-// Dark matter stun
-//----------------------------
-
-/obj/effect/projectile/darkmatterstun/tracer
- icon_state = "darkt"
- light_range = 2
- light_power = 0.5
- light_color = "#8837A3"
-
-/obj/effect/projectile/darkmatterstun/muzzle
- icon_state = "muzzle_darkt"
- light_range = 2
- light_power = 0.5
- light_color = "#8837A3"
-
-/obj/effect/projectile/darkmatterstun/impact
- icon_state = "impact_darkt"
- light_range = 2
- light_power = 0.5
- light_color = "#8837A3"
-
-//----------------------------
-// Dark matter
-//----------------------------
-
-/obj/effect/projectile/darkmatter/tracer
- icon_state = "darkb"
- light_range = 2
- light_power = 0.5
- light_color = "#8837A3"
-
-/obj/effect/projectile/darkmatter/muzzle
- icon_state = "muzzle_darkb"
- light_range = 2
- light_power = 0.5
- light_color = "#8837A3"
-
-/obj/effect/projectile/darkmatter/impact
- icon_state = "impact_darkb"
- light_range = 2
- light_power = 0.5
- light_color = "#8837A3"
-
-//----------------------------
-// Inversion / Cult
-//----------------------------
-/obj/effect/projectile/inversion/tracer
- icon_state = "invert"
- light_range = 2
- light_power = -2
- light_color = "#FFFFFF"
-
-/obj/effect/projectile/inversion/muzzle
- icon_state = "muzzle_invert"
- light_range = 2
- light_power = -2
- light_color = "#FFFFFF"
-
-/obj/effect/projectile/inversion/impact
- icon_state = "impact_invert"
- light_range = 2
- light_power = -2
- light_color = "#FFFFFF"
diff --git a/code/modules/projectiles/firing_pin.dm b/code/modules/projectiles/guns/firing_pin.dm
similarity index 100%
rename from code/modules/projectiles/firing_pin.dm
rename to code/modules/projectiles/guns/firing_pin.dm
From b093e3066b59bea9cbe7a46e09b101066fdba16a Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 19:23:58 +0000
Subject: [PATCH 37/68] sigh
---
code/modules/projectiles/guns/firing_pin.dm | 18 ++++++++++++++----
.../modules/projectiles/guns/gun_component.dm | 14 +++++++++++---
icons/modules/projectiles/gun_components.dmi | Bin 0 -> 643 bytes
3 files changed, 25 insertions(+), 7 deletions(-)
create mode 100644 icons/modules/projectiles/gun_components.dmi
diff --git a/code/modules/projectiles/guns/firing_pin.dm b/code/modules/projectiles/guns/firing_pin.dm
index bc63a65de4f1..2362202f3b9a 100644
--- a/code/modules/projectiles/guns/firing_pin.dm
+++ b/code/modules/projectiles/guns/firing_pin.dm
@@ -1,3 +1,14 @@
+/**
+ * Firing pins used to pretty much control who can use how many guns.
+ *
+ * The old system was lockboxes; those weren't really fun and there wasn't a good way
+ * to bypass it without an emag.
+ *
+ * Nowadays we just use firing pins and control who can print those.
+ *
+ * In the future, this system may be augmented or replaced, as to make it more
+ * valuable to have a weapon (as opposed to a pin for one).
+ */
/obj/item/firing_pin
name = "electronic firing pin"
desc = "A small authentication device, to be inserted into a firearm receiver to allow operation. NT safety regulations require all new designs to incorporate one."
@@ -84,7 +95,6 @@
return TRUE
return FALSE
-
// Implant pin, checks for implant
/obj/item/firing_pin/implant
name = "implant-keyed firing pin"
@@ -197,15 +207,15 @@
return lock_override
//Allows swiping an armoury access ID on an explorer locked gun to unlock it
-/obj/item/gun/attackby(obj/item/I, mob/user)
+/obj/item/gun/attackby(obj/item/I, mob/living/user, list/params, clickchain_flags, damage_multiplier)
if((istype(I, /obj/item/card/id)) && pin)
pin.attackby(I, user)
else
return ..()
-/obj/item/firing_pin/explorer/attackby(obj/item/card/ID, mob/user)
+/obj/item/firing_pin/explorer/attackby(obj/item/I, mob/living/user, list/params, clickchain_flags, damage_multiplier)
..()
- if(check_access(ID))
+ if(check_access(I))
locked = !locked
to_chat(user, "You [locked ? "enable" : "disable"] the safety lock on \the [src].")
else
diff --git a/code/modules/projectiles/guns/gun_component.dm b/code/modules/projectiles/guns/gun_component.dm
index 9c39deee0ec1..6a9fa61773bb 100644
--- a/code/modules/projectiles/guns/gun_component.dm
+++ b/code/modules/projectiles/guns/gun_component.dm
@@ -8,7 +8,9 @@
*/
/obj/item/gun_component
name = "gun component"
- desc = "A thing, that probably goes in a gun."
+ desc = "A thing, that probably goes in a gun. Why are you seeing this?"
+ icon = 'icons/modules/projectiles/gun_components.dmi'
+ icon_state = "" // empty state
/// component slot
///
@@ -23,9 +25,15 @@
/**
* returns if we should fit on a gun
*
- * we get the final say
+ * * we get the final say
+ * * this includes if the gun is already overcrowded! be careful with this
+ *
+ * @params
+ * * gun - the gun we tried to attach to
+ * * gun_opinion - what the gun had to say about it
+ * * gun_is_full - is the gun out of slots for us? we can still override but this is to separate it from gun_opinion.
*/
-/obj/item/gun_component/proc/fits_on_gun(obj/item/gun/gun, gun_opinion)
+/obj/item/gun_component/proc/fits_on_gun(obj/item/gun/gun, gun_opinion, gun_is_full)
return TRUE
/**
diff --git a/icons/modules/projectiles/gun_components.dmi b/icons/modules/projectiles/gun_components.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..1ae4da67932b5f07031661c07d0f09bf388c7fa2
GIT binary patch
literal 643
zcmV-}0(||6P)V=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+
z(=$pSoZ^zil2jm5Nr{UyC9|j)$TZ~QOe;#vO@*+P6)t
zE(W%xY-BqK7r>bfL5WYDm4o4f#s`Mz{Spj;tN0jxMgIaj1|()+U;tJF!XPmiJCT(G
zuAdlyGXzrpF)};_(kgc)7{q|Iw4fk^*eV8wR}6d%cYyp0zb`PPr4=z~Y3VT(6eKWI
zOz2>+u&@PUWrhh87J$VlasUXN*VbS-@Z$gjgB$}e3O<3wzP7$X-(*c^mQ9%Ok|Ru(*gu3NVbEQag|f+ZmcfIX?{9gb)B_xu&Kj6frY1GZa47l8~NYz#FBb
d4j6C;000q8xY5QjptJx0002ovPDHLkV1me}`t$$*
literal 0
HcmV?d00001
From ac1f08c1849b4991f737748144ec485ae264dcd2 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 10 Sep 2024 22:06:17 -0400
Subject: [PATCH 38/68] Fix
---
code/modules/projectiles/guns/gun.dm | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 5c296a379f35..878ebbe4fd5e 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -283,13 +283,17 @@
slot.remove_yank_context = TRUE
// modular components //
- if(islist(modular_component_slots) && !(modular_component_slots = get_typelist(NAMEOF(src, modular_component_slots))))
- // if it's 1. a list and 2. we can't grab a typelist for it,
- // we make it, patching internal modules lazily
- var/internal_modules_patch = modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE]
- if(isnull(internal_modules_patch))
- modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE] = modular_component_slots_internal
- modular_component_slots = typelist(NAMEOF(src, modular_component_slots), modular_component_slots)
+ if(islist(modular_component_slots))
+ var/list/existing_typelist = get_typelist(NAMEOF(src, modular_component_slots))
+ if(existing_typelist)
+ modular_component_slots = existing_typelist
+ else
+ // if it's 1. a list and 2. we can't grab a typelist for it,
+ // we make it, patching internal modules lazily
+ var/internal_modules_patch = modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE]
+ if(isnull(internal_modules_patch))
+ modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE] = modular_component_slots_internal
+ modular_component_slots = typelist(NAMEOF(src, modular_component_slots), modular_component_slots)
/obj/item/gun/examine(mob/user, dist)
. = ..()
From 29a95cd3a569059bd7355393d810f7798506acfe Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 13 Sep 2024 20:55:35 +0000
Subject: [PATCH 39/68] that
---
code/modules/clothing/chameleon.dm | 2 +-
.../mining/tools/kinetic_accelerator.dm | 2 +-
code/modules/projectiles/guns/ballistic.dm | 20 +++++++++----------
.../projectiles/guns/ballistic/contender.dm | 2 +-
.../projectiles/guns/ballistic/dartgun.dm | 2 +-
.../ballistic/microbattery/microbattery.dm | 2 +-
.../projectiles/guns/ballistic/pistol.dm | 2 +-
.../projectiles/guns/ballistic/revolver.dm | 2 +-
.../projectiles/guns/ballistic/rocket.dm | 12 +++++------
.../projectiles/guns/ballistic/shotgun.dm | 2 +-
code/modules/projectiles/guns/energy.dm | 2 +-
code/modules/projectiles/guns/energy/laser.dm | 2 +-
.../projectiles/guns/energy/sizegun_vr.dm | 2 +-
.../projectiles/guns/energy/special.dm | 12 +++++------
code/modules/projectiles/guns/firing_pin.dm | 2 +-
.../guns/gun-projectile-implementation.dm | 5 +++--
code/modules/projectiles/guns/launcher.dm | 4 ++--
.../projectiles/guns/launcher/crossbow.dm | 2 +-
.../guns/launcher/grenade_launcher.dm | 8 --------
.../projectiles/guns/launcher/pneumatic.dm | 2 +-
.../projectiles/guns/launcher/syringe_gun.dm | 2 +-
code/modules/projectiles/guns/magic.dm | 2 +-
code/modules/projectiles/guns/magnetic.dm | 4 ++--
code/modules/projectiles/guns/vox.dm | 2 +-
24 files changed, 44 insertions(+), 55 deletions(-)
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index b1e64af2f878..05becb32f2e5 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -380,7 +380,7 @@
var/obj/item/gun/G = gun_type
src.gun_choices[initial(G.name)] = gun_type
-/obj/item/gun/energy/chameleon/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/chameleon/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
var/obj/projectile/P = ..()
if(istype(P) && ispath(copy_projectile))
P.name = initial(copy_projectile.name)
diff --git a/code/modules/mining/tools/kinetic_accelerator.dm b/code/modules/mining/tools/kinetic_accelerator.dm
index 6370d11503a5..34d96399c938 100644
--- a/code/modules/mining/tools/kinetic_accelerator.dm
+++ b/code/modules/mining/tools/kinetic_accelerator.dm
@@ -40,7 +40,7 @@
var/recharge_timerid
-/obj/item/gun/energy/kinetic_accelerator/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/kinetic_accelerator/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(overheat)
return GUN_FIRED_FAIL_EMPTY
. = ..()
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index cc74c7ad3094..ccfa3dc58333 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -78,7 +78,7 @@
icon_state = "[silenced_state][magazine_state]"
// todo: rework
-/obj/item/gun/ballistic/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
//get the next casing
if(loaded.len)
chambered = loaded[1] //load next casing.
@@ -88,19 +88,17 @@
chambered = ammo_magazine.pop(src)
if (chambered)
- return chambered.get_projectile()
+ return chambered.expend()
return null
-/obj/item/gun/ballistic/handle_post_fire()
- ..()
- if(chambered)
- chambered.expend()
- process_chambered()
-
-/obj/item/gun/ballistic/handle_click_empty()
- ..()
- process_chambered()
+/obj/item/gun/ballistic/post_fire(atom/firer, angle, firing_flags, datum/firemode/firemode, iteration, firing_result, atom/target, datum/event_args/actor/actor)
+ . = ..()
+ switch(firing_result)
+ // process chamber
+ if(GUN_FIRED_FAIL_INERT, GUN_FIRED_SUCCESS, GUN_FIRED_FAIL_EMPTY)
+ process_chambered()
+// todo: refactor
/obj/item/gun/ballistic/proc/process_chambered()
if (!chambered) return
diff --git a/code/modules/projectiles/guns/ballistic/contender.dm b/code/modules/projectiles/guns/ballistic/contender.dm
index 56aedf1287a0..b34a0888a42b 100644
--- a/code/modules/projectiles/guns/ballistic/contender.dm
+++ b/code/modules/projectiles/guns/ballistic/contender.dm
@@ -104,7 +104,7 @@
projectile_type = /obj/projectile/bullet/shotgun
unstable = 1
-/obj/item/gun/ballistic/contender/pipegun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/contender/pipegun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/dartgun.dm b/code/modules/projectiles/guns/ballistic/dartgun.dm
index c2704b2faa88..b5304da6daaf 100644
--- a/code/modules/projectiles/guns/ballistic/dartgun.dm
+++ b/code/modules/projectiles/guns/ballistic/dartgun.dm
@@ -52,7 +52,7 @@
else
icon_state = "[base_state]"
-/obj/item/gun/ballistic/dartgun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/dartgun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
var/obj/projectile/bullet/chemdart/dart = .
if(istype(dart))
diff --git a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
index 0d78d76eba49..398e1a532988 100644
--- a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
+++ b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
@@ -26,7 +26,7 @@
var/max_charge = 0
charge_sections = 5
-/obj/item/gun/ballistic/microbattery/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/microbattery/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(chambered && ammo_magazine)
var/obj/item/ammo_casing/microbattery/batt = chambered
if(batt.shots_left)
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index 96d9e30873e3..67b8aaf2caac 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -250,7 +250,7 @@
return ..()
// todo: dumb
-/obj/item/gun/ballistic/pirate/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/pirate/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index 9afa1e3e1497..cd6254b7605a 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -31,7 +31,7 @@
chamber_offset = rand(0,max_shells - loaded.len)
// todo: dumb
-/obj/item/gun/ballistic/revolver/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/revolver/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(chamber_offset)
chamber_offset--
return
diff --git a/code/modules/projectiles/guns/ballistic/rocket.dm b/code/modules/projectiles/guns/ballistic/rocket.dm
index 8b816de7892a..c353a7615317 100644
--- a/code/modules/projectiles/guns/ballistic/rocket.dm
+++ b/code/modules/projectiles/guns/ballistic/rocket.dm
@@ -59,10 +59,10 @@
return null
*/
-/obj/item/gun/ballistic/rocket/handle_post_fire(mob/user, atom/target)
- message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([src.name]) at [target].")
- log_game("[key_name_admin(user)] used a rocket launcher ([src.name]) at [target].")
- ..()
+// /obj/item/gun/ballistic/rocket/handle_post_fire(mob/user, atom/target)
+// message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([src.name]) at [target].")
+// log_game("[key_name_admin(user)] used a rocket launcher ([src.name]) at [target].")
+// ..()
/obj/item/gun/ballistic/rocket/collapsible
name = "disposable rocket launcher"
@@ -108,7 +108,7 @@
item_state = "[initial(item_state)]"
collapsed = 1
-/obj/item/gun/ballistic/rocket/collapsible/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/rocket/collapsible/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(empty)
return
@@ -127,7 +127,7 @@
unstable = 1
// todo: dumb
-/obj/item/gun/ballistic/rocket/tyrmalin/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/rocket/tyrmalin/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index 84a9057a7727..f227a1964269 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -21,7 +21,7 @@
var/animated_pump = 0 //This is for cyling animations.
var/empty_sprite = 0 //This is just a dirty var so it doesn't fudge up.
-/obj/item/gun/ballistic/shotgun/pump/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/shotgun/pump/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return chambered?.get_projectile()
/obj/item/gun/ballistic/shotgun/pump/attack_self(mob/user)
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 46f6dfc64d45..3dc7dc2c3004 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -101,7 +101,7 @@
..()
update_icon()
-/obj/item/gun/energy/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!obj_cell_slot?.cell)
return null
if(!ispath(projectile_type))
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 42748084733f..e1880e4a62af 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -316,7 +316,7 @@
unstable = 1
// todo: this is dumb
-/obj/item/gun/energy/zip/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/zip/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/energy/sizegun_vr.dm b/code/modules/projectiles/guns/energy/sizegun_vr.dm
index 0e1f680224ce..501abe33a25c 100644
--- a/code/modules/projectiles/guns/energy/sizegun_vr.dm
+++ b/code/modules/projectiles/guns/energy/sizegun_vr.dm
@@ -34,7 +34,7 @@
. = ..()
select_size()
-/obj/item/gun/energy/sizegun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/sizegun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
var/obj/projectile/beam/sizelaser/G = .
if(istype(G))
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 2a6e5d42c315..0fb18bd51cd3 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -28,6 +28,9 @@
charge_cost = 480
projectile_type = /obj/projectile/ion/pistol
+/obj/item/gun/energy/ionrifle/weak
+ projectile_type = /obj/projectile/ion/small
+
/obj/item/gun/energy/decloner
name = "biological demolecularisor"
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
@@ -77,7 +80,7 @@
to_chat(usr, "You set the [src]'s targeted genetic area to [genemask].")
-/obj/item/gun/energy/floragun/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/floragun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = ..()
var/obj/projectile/energy/floramut/gene/G = .
if(istype(G))
@@ -290,16 +293,11 @@
else
if(beameffect)
qdel(beameffect)
- handle_click_empty(user)
+ post_empty_fire(actor = new /datum/event_args/actor(user))
power_cycle = FALSE
else
to_chat(user, "\The [src] is already powering up!")
-//_vr Items:
-
-/obj/item/gun/energy/ionrifle/weak
- projectile_type = /obj/projectile/ion/small
-
/obj/item/gun/energy/medigun //Adminspawn/ERT etc
name = "directed restoration system"
desc = "The BL-3 'Phoenix' is an adaptation on the ML-3 'Medbeam' design that channels the power of the beam into a single healing laser. It is highly energy-inefficient, but its medical power cannot be denied."
diff --git a/code/modules/projectiles/guns/firing_pin.dm b/code/modules/projectiles/guns/firing_pin.dm
index 2362202f3b9a..4d06825e3637 100644
--- a/code/modules/projectiles/guns/firing_pin.dm
+++ b/code/modules/projectiles/guns/firing_pin.dm
@@ -220,7 +220,7 @@
to_chat(user, "You [locked ? "enable" : "disable"] the safety lock on \the [src].")
else
to_chat(user, "Access denied.")
- user.visible_message("[user] swipes \the [ID] against \the [src].")
+ user.visible_message("[user] swipes \the [I] against \the [src].")
/obj/item/firing_pin/emag_act(var/remaining_charges, var/mob/user)
if(emagged)
diff --git a/code/modules/projectiles/guns/gun-projectile-implementation.dm b/code/modules/projectiles/guns/gun-projectile-implementation.dm
index 8fcab36612ef..7110405ea3b8 100644
--- a/code/modules/projectiles/guns/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/guns/gun-projectile-implementation.dm
@@ -22,6 +22,7 @@
*
* * Things like jams go in here.
* * Things like 'the next bullet is empty so we fail' go in here
+ * * This should be called *as* the point of no return. This has side effects.
* * Everything is optional here. Things like portable turrets reserve the right to 'pull' from the gun without caring about params.
*
* @params
@@ -29,9 +30,9 @@
* * firing_flags - (optional) GUN_FIRING_* flags
* * firemode - (optional) the firemode
* * actor - (optional) the initiator
- * * firer - (optional) the actual firer.
+ * * firer - (optional) the actual firer
*/
-/obj/item/gun/proc/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/proc/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = GUN_FIRED_FAIL_UNKNOWN
// todo: on base /gun/projectile?
CRASH("attempted to process next projectile on base /gun")
diff --git a/code/modules/projectiles/guns/launcher.dm b/code/modules/projectiles/guns/launcher.dm
index 060665b74fba..e9254c40d0f8 100644
--- a/code/modules/projectiles/guns/launcher.dm
+++ b/code/modules/projectiles/guns/launcher.dm
@@ -29,6 +29,6 @@
/**
* Returns the next /atom/movable to throw, or a GUN_FIRED_* for fail satus.
*/
-/obj/item/gun/launcher/proc/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/launcher/proc/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = GUN_FIRED_FAIL_UNKNOWN
- CRASH("attempted to process_next_entity on base /gun/launcher")
+ CRASH("attempted to consume_next_throwable on base /gun/launcher")
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index f3f55f701440..fedf4bda26fb 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -81,7 +81,7 @@
return
return ..()
-/obj/item/gun/launcher/crossbow/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/launcher/crossbow/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return bolt
/obj/item/gun/launcher/crossbow/handle_post_fire(mob/user, atom/target)
diff --git a/code/modules/projectiles/guns/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
index 319caebd3244..194660e4032c 100644
--- a/code/modules/projectiles/guns/launcher/grenade_launcher.dm
+++ b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
@@ -83,14 +83,6 @@
else
..()
-/*//This broke for no reason. Look into it.
-/obj/item/gun/launcher/grenade/consume_next_projectile()
- if(chambered)
- chambered.det_time = 10
- chambered.activate(null)
- return chambered
-*/
-
/obj/item/gun/launcher/grenade/handle_post_fire(mob/user)
message_admins("[key_name_admin(user)] fired a grenade ([chambered.name]) from a grenade launcher ([src.name]).")
log_game("[key_name_admin(user)] used a grenade ([chambered.name]).")
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index 64900aecedc7..c6b9dc9b872a 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -83,7 +83,7 @@
return
eject_tank(user)
-/obj/item/gun/launcher/pneumatic/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/launcher/pneumatic/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!item_storage.contents.len)
return GUN_FIRED_FAIL_EMPTY
if (!tank)
diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm
index b9c6ab1cdad9..ee48a57b60e0 100644
--- a/code/modules/projectiles/guns/launcher/syringe_gun.dm
+++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm
@@ -84,7 +84,7 @@
var/max_darts = 1
var/obj/item/syringe_cartridge/next
-/obj/item/gun/launcher/syringe/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/launcher/syringe/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(next)
next.prime()
return next
diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm
index b989a7b26dde..e602df2ff660 100644
--- a/code/modules/projectiles/guns/magic.dm
+++ b/code/modules/projectiles/guns/magic.dm
@@ -67,7 +67,7 @@
recharge_newshot()
return 1
-/obj/item/gun/magic/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/magic/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
return chambered?.get_projectile()
/obj/item/gun/magic/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
diff --git a/code/modules/projectiles/guns/magnetic.dm b/code/modules/projectiles/guns/magnetic.dm
index 89ff6758f504..0125fd877b3a 100644
--- a/code/modules/projectiles/guns/magnetic.dm
+++ b/code/modules/projectiles/guns/magnetic.dm
@@ -165,7 +165,7 @@
qdel(loaded)
loaded = null
-/obj/item/gun/magnetic/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/magnetic/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
@@ -206,7 +206,7 @@
capacitor = new /obj/item/stock_parts/capacitor
return ..()
-/obj/item/gun/magnetic/fuelrod/process_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/magnetic/fuelrod/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
diff --git a/code/modules/projectiles/guns/vox.dm b/code/modules/projectiles/guns/vox.dm
index 004948e0175d..a73c7293be30 100644
--- a/code/modules/projectiles/guns/vox.dm
+++ b/code/modules/projectiles/guns/vox.dm
@@ -46,7 +46,7 @@
/obj/item/gun/launcher/spikethrower/update_release_force()
return
-/obj/item/gun/launcher/spikethrower/process_next_entity(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/launcher/spikethrower/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(spikes < 1) return null
spikes--
return new /obj/item/spike(src)
From cbf2976a4a5061f2b5da35bc609210a5083c4450 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 13 Sep 2024 21:11:44 +0000
Subject: [PATCH 40/68] sigh
---
code/modules/projectiles/guns/gun-firing.dm | 17 +++++++++++++++++
code/modules/projectiles/guns/gun.dm | 13 -------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/code/modules/projectiles/guns/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
index 7371fa837abc..29e07331ee4b 100644
--- a/code/modules/projectiles/guns/gun-firing.dm
+++ b/code/modules/projectiles/guns/gun-firing.dm
@@ -115,6 +115,23 @@
SHOULD_NOT_SLEEP(TRUE)
#warn impl; check unmount
+ // todo: sigh
+ var/held_twohanded = TRUE
+ if(ismob(user))
+ var/mob/mob_firer = firer
+ held_twohanded = mob_firer.can_wield_item(src) && is_held_twohanded(mob_firer)
+
+ // point of no return
+ var/obj/projectile/firing_projectile = consume_next_projectile(iteration, firing_flags, firemode, actor, firer)
+ if(!istype(firing_projectile))
+ // it's an error code if it's not real
+ return firing_projectile
+
+ // todo: do we really need to newtonian move always?
+ if(ismovable(firer))
+ var/atom/movable/movable_firer = firer
+ movable_firer.newtonian_move(angle2dir(angle))
+
/**
* Called to handle post fire
*
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 878ebbe4fd5e..4b87bc23b9ff 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -521,18 +521,10 @@
next_fire_time = world.time + shoot_time
- var/held_twohanded = (user.can_wield_item(src) && src.is_held_twohanded(user))
-
//actually attempt to shoot
var/turf/targloc = get_turf(target) //cache this in case target gets deleted during shooting, e.g. if it was a securitron that got destroyed.
for(var/i in 1 to burst)
- var/obj/projectile = consume_next_projectile(user)
- if(!projectile)
- handle_click_empty(user)
- break
-
- user.newtonian_move(get_dir(target, user)) // Recoil
process_accuracy(projectile, user, target, i, held_twohanded)
@@ -652,11 +644,6 @@
if(muzzle_flash)
set_light(0)
-//obtains the next projectile to fire
-#warn get rid of this
-/obj/item/gun/proc/consume_next_projectile()
- SHOULD_NOT_OVERRIDE(TRUE)
-
//used by aiming code
/obj/item/gun/proc/can_hit(atom/target as mob, var/mob/living/user as mob)
if(!special_check(user))
From e620ac62fdf4567a629e91c6b44f121e3facf73e Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 13 Sep 2024 21:14:45 +0000
Subject: [PATCH 41/68] That
---
code/modules/projectiles/guns/gun.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 4b87bc23b9ff..ab9efa8a1d0c 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -486,6 +486,7 @@
pin.emag_act(remaining_charges, user)
/obj/item/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0)
+ SHOULD_NOT_OVERRIDE(TRUE)
if(!user || !target) return
if(target.z != user.z) return
@@ -573,6 +574,7 @@
// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
/obj/item/gun/proc/Fire_userless(atom/target)
+ SHOULD_NOT_OVERRIDE(TRUE)
if(!target)
return
From 7db7a867848b358aa482ead77dc18b6896f84339 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 4 Nov 2024 21:19:30 +0000
Subject: [PATCH 42/68] that
---
citadel.dme | 16 +-
code/modules/clothing/chameleon.dm | 2 +-
.../mining/tools/kinetic_accelerator.dm | 2 +-
code/modules/projectiles/guns/ballistic.dm | 2 +-
.../projectiles/guns/ballistic/contender.dm | 2 +-
.../projectiles/guns/ballistic/dartgun.dm | 2 +-
.../ballistic/microbattery/microbattery.dm | 2 +-
.../projectiles/guns/ballistic/pistol.dm | 2 +-
.../projectiles/guns/ballistic/revolver.dm | 2 +-
.../projectiles/guns/ballistic/rocket.dm | 6 +-
.../projectiles/guns/ballistic/shotgun.dm | 2 +-
code/modules/projectiles/guns/energy.dm | 2 +-
code/modules/projectiles/guns/energy/laser.dm | 2 +-
.../projectiles/guns/energy/sizegun_vr.dm | 2 +-
.../projectiles/guns/energy/special.dm | 2 +-
code/modules/projectiles/guns/gun-firing.dm | 161 ++++++++----------
code/modules/projectiles/guns/gun-modular.dm | 23 +++
.../guns/gun-projectile-implementation.dm | 37 ++--
code/modules/projectiles/guns/gun.dm | 100 ++---------
.../projectiles/guns/gun_firing_cycle.dm | 50 ++++++
code/modules/projectiles/guns/magic.dm | 2 +-
code/modules/projectiles/guns/magnetic.dm | 4 +-
22 files changed, 201 insertions(+), 224 deletions(-)
create mode 100644 code/modules/projectiles/guns/gun_firing_cycle.dm
diff --git a/citadel.dme b/citadel.dme
index ae9a07ea4e7d..1857463b0d04 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4470,6 +4470,7 @@
#include "code\modules\projectiles\guns\gun-projectile-implementation.dm"
#include "code\modules\projectiles\guns\gun.dm"
#include "code\modules\projectiles\guns\gun_component.dm"
+#include "code\modules\projectiles\guns\gun_firing_cycle.dm"
#include "code\modules\projectiles\guns\gun_item_renderer.dm"
#include "code\modules\projectiles\guns\gun_mob_renderer.dm"
#include "code\modules\projectiles\guns\launcher.dm"
@@ -4541,21 +4542,6 @@
#include "code\modules\projectiles\guns\magnetic\bore.dm"
#include "code\modules\projectiles\guns\magnetic\magnetic_construction.dm"
#include "code\modules\projectiles\guns\magnetic\magnetic_railgun.dm"
-#include "code\modules\projectiles\guns\projectile\automatic.dm"
-#include "code\modules\projectiles\guns\projectile\boltaction.dm"
-#include "code\modules\projectiles\guns\projectile\bow.dm"
-#include "code\modules\projectiles\guns\projectile\caseless.dm"
-#include "code\modules\projectiles\guns\projectile\contender.dm"
-#include "code\modules\projectiles\guns\projectile\dartgun.dm"
-#include "code\modules\projectiles\guns\projectile\musket.dm"
-#include "code\modules\projectiles\guns\projectile\pistol.dm"
-#include "code\modules\projectiles\guns\projectile\revolver.dm"
-#include "code\modules\projectiles\guns\projectile\rocket.dm"
-#include "code\modules\projectiles\guns\projectile\semiauto.dm"
-#include "code\modules\projectiles\guns\projectile\shotgun.dm"
-#include "code\modules\projectiles\guns\projectile\sniper.dm"
-#include "code\modules\projectiles\guns\projectile\caseless\pellet.dm"
-#include "code\modules\projectiles\guns\projectile\sniper\collapsible_sniper.dm"
#include "code\modules\projectiles\projectile\helpers.dm"
#include "code\modules\projectiles\projectile\projectile-hitscan_visuals.dm"
#include "code\modules\projectiles\projectile\projectile-physics.dm"
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index 05becb32f2e5..78d84f601e8d 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -380,7 +380,7 @@
var/obj/item/gun/G = gun_type
src.gun_choices[initial(G.name)] = gun_type
-/obj/item/gun/energy/chameleon/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/chameleon/consume_next_projectile(datum/gun_firing_cycle/cycle)
var/obj/projectile/P = ..()
if(istype(P) && ispath(copy_projectile))
P.name = initial(copy_projectile.name)
diff --git a/code/modules/mining/tools/kinetic_accelerator.dm b/code/modules/mining/tools/kinetic_accelerator.dm
index ddeb130e8be7..7d491e1392d9 100644
--- a/code/modules/mining/tools/kinetic_accelerator.dm
+++ b/code/modules/mining/tools/kinetic_accelerator.dm
@@ -40,7 +40,7 @@
var/recharge_timerid
-/obj/item/gun/energy/kinetic_accelerator/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/kinetic_accelerator/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(overheat)
return GUN_FIRED_FAIL_EMPTY
. = ..()
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index 210b99644dfe..c171264ef0d8 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -104,7 +104,7 @@
icon_state = "[silenced_state][magazine_state]"
// todo: rework
-/obj/item/gun/ballistic/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/consume_next_projectile(datum/gun_firing_cycle/cycle)
//get the next casing
if(loaded.len)
chambered = loaded[1] //load next casing.
diff --git a/code/modules/projectiles/guns/ballistic/contender.dm b/code/modules/projectiles/guns/ballistic/contender.dm
index dc888350a3a6..e0fa902a58d0 100644
--- a/code/modules/projectiles/guns/ballistic/contender.dm
+++ b/code/modules/projectiles/guns/ballistic/contender.dm
@@ -104,7 +104,7 @@
projectile_type = /obj/projectile/bullet/shotgun
unstable = 1
-/obj/item/gun/ballistic/contender/pipegun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/contender/pipegun/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/dartgun.dm b/code/modules/projectiles/guns/ballistic/dartgun.dm
index c1ca3ebaeed2..6b288b2cdf6a 100644
--- a/code/modules/projectiles/guns/ballistic/dartgun.dm
+++ b/code/modules/projectiles/guns/ballistic/dartgun.dm
@@ -52,7 +52,7 @@
else
icon_state = "[base_state]"
-/obj/item/gun/ballistic/dartgun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/dartgun/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
var/obj/projectile/bullet/chemdart/dart = .
if(istype(dart))
diff --git a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
index 8bc1636728cd..9d2c3afee138 100644
--- a/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
+++ b/code/modules/projectiles/guns/ballistic/microbattery/microbattery.dm
@@ -26,7 +26,7 @@
var/max_charge = 0
charge_sections = 5
-/obj/item/gun/ballistic/microbattery/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/microbattery/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(chambered && ammo_magazine)
var/obj/item/ammo_casing/microbattery/batt = chambered
if(batt.shots_left)
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index 49e9460683de..f89cf912e32a 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -250,7 +250,7 @@
return ..()
// todo: dumb
-/obj/item/gun/ballistic/pirate/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/pirate/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index ca16c7be8019..e5c3713aa852 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -31,7 +31,7 @@
chamber_offset = rand(0,max_shells - loaded.len)
// todo: dumb
-/obj/item/gun/ballistic/revolver/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/revolver/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(chamber_offset)
chamber_offset--
return
diff --git a/code/modules/projectiles/guns/ballistic/rocket.dm b/code/modules/projectiles/guns/ballistic/rocket.dm
index ec8b48d4808b..fe0ffd145d7d 100644
--- a/code/modules/projectiles/guns/ballistic/rocket.dm
+++ b/code/modules/projectiles/guns/ballistic/rocket.dm
@@ -51,7 +51,7 @@
else
..()
-/obj/item/gun/launcher/rocket/consume_next_projectile()
+/obj/item/gun/launcher/rocket/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(rockets.len)
var/obj/item/ammo_casing/rocket/I = rockets[1]
rockets -= I
@@ -108,7 +108,7 @@
item_state = "[initial(item_state)]"
collapsed = 1
-/obj/item/gun/ballistic/rocket/collapsible/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/rocket/collapsible/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
if(empty)
return
@@ -127,7 +127,7 @@
unstable = 1
// todo: dumb
-/obj/item/gun/ballistic/rocket/tyrmalin/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/rocket/tyrmalin/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index 818f72e1cee2..f0ded91bb67d 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -21,7 +21,7 @@
var/animated_pump = 0 //This is for cyling animations.
var/empty_sprite = 0 //This is just a dirty var so it doesn't fudge up.
-/obj/item/gun/ballistic/shotgun/pump/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/ballistic/shotgun/pump/consume_next_projectile(datum/gun_firing_cycle/cycle)
return chambered?.get_projectile()
/obj/item/gun/ballistic/shotgun/pump/attack_self(mob/user, datum/event_args/actor/actor)
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 3dc7dc2c3004..8f919c5f806c 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -101,7 +101,7 @@
..()
update_icon()
-/obj/item/gun/energy/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(!obj_cell_slot?.cell)
return null
if(!ispath(projectile_type))
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index e1880e4a62af..85a5566841cc 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -316,7 +316,7 @@
unstable = 1
// todo: this is dumb
-/obj/item/gun/energy/zip/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/zip/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
if(.)
if(unstable)
diff --git a/code/modules/projectiles/guns/energy/sizegun_vr.dm b/code/modules/projectiles/guns/energy/sizegun_vr.dm
index b477a1f28b87..30b280ab7706 100644
--- a/code/modules/projectiles/guns/energy/sizegun_vr.dm
+++ b/code/modules/projectiles/guns/energy/sizegun_vr.dm
@@ -34,7 +34,7 @@
. = ..()
select_size()
-/obj/item/gun/energy/sizegun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/sizegun/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
var/obj/projectile/beam/sizelaser/G = .
if(istype(G))
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index d6c46c7ef02c..dffe99e564d6 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -80,7 +80,7 @@
to_chat(usr, "You set the [src]'s targeted genetic area to [genemask].")
-/obj/item/gun/energy/floragun/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/energy/floragun/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = ..()
var/obj/projectile/energy/floramut/gene/G = .
if(istype(G))
diff --git a/code/modules/projectiles/guns/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
index 29e07331ee4b..a0e0e6ca538b 100644
--- a/code/modules/projectiles/guns/gun-firing.dm
+++ b/code/modules/projectiles/guns/gun-firing.dm
@@ -6,58 +6,66 @@
/**
* async proc to start a firing cycle
*
- * @return firing cycle ID on success, null on fail.
+ * @return firing cycle datum
*/
-/obj/item/gun/proc/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
+/obj/item/gun/proc/async_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
SHOULD_CALL_PARENT(TRUE)
SHOULD_NOT_SLEEP(TRUE)
- /**
- * it's important we invoke async, **not** spawn(0)
- *
- * this is so debugging and other systems that care about call stack
- * still attribute the call to the user until it sleeps for the first time
- *
- * just because we support async doesn't mean we actually want it
- * to be async unless it needs to be; there's no reason to do so
- * (and if something weird is going on we do want the initial proc to be attributed to the caller)
- */
- #warn impl
+ // invoke async; when it returns, our firing_cycle will still be set
+ INVOKE_ASYNC(PROC_REF(firing_cycle), firer, angle, firing_flags, firemode, target, actor)
+ // check to make sure it's always set
+ ASSERT(firing_cycle)
+ // return it; beware that it can be mutated in the firing cycle.
+ return firing_cycle
+
+/**
+ * starts, and blocks on a firing cycle
+ */
+/obj/item/gun/proc/blocking_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
+ SHOULD_CALL_PARENT(TRUE)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ return firing_cycle(firer, angle, firing_flags, firemode, target, actor)
/**
- * returns a given firing cycle ID; if none is provided, we interrupt any active firing cycle.
+ * interrupts a given firing cycle ID; if none is provided, we interrupt any active firing cycle.
*/
/obj/item/gun/proc/interrupt_firing_cycle(cycle_id)
SHOULD_NOT_SLEEP(TRUE)
SHOULD_NOT_OVERRIDE(TRUE)
- firing_cycle = firing_cycle + 1
+ if(cycle_id && firing_cycle?.notch != cycle_id)
+ return
+ firing_cycle = null
/**
* Hook for firing cycle start
*/
-/obj/item/gun/proc/on_firing_cycle_start(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
+/obj/item/gun/proc/on_firing_cycle_start(datum/gun_firing_cycle/cycle)
SHOULD_NOT_SLEEP(TRUE)
/**
* Hook for firing cycle end
*/
-/obj/item/gun/proc/on_firing_cycle_end(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor, iterations_fired, last_firing_result)
+/obj/item/gun/proc/on_firing_cycle_end(datum/gun_firing_cycle/cycle)
SHOULD_NOT_SLEEP(TRUE)
/**
* called exactly once at the start of a firing cycle to start it
*
* @params
- * * cycle_id - the cycle id to use; this is provided by start_firing_cycle
- * * firer - the thing physically firing us; whether a turret or a person
+ * * firer - the thing physically firing us; whether a turret or a person.
+ * this is where the projectile will originate, not the physical location of the gun.
* * angle - the angle to fire in.
* * firing_flags - GUN_FIRING_* flags
- * * firemode - the /datum/firemode we are firing on
+ * * firemode - (optional) the /datum/firemode we are firing on
* * target - (optional) what we're firing at
* * actor - (optional) the person who initiated the firing
+ *
+ * @return the gun firing cycle made and used
*/
-/obj/item/gun/proc/firing_cycle(cycle_id, atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor)
+/obj/item/gun/proc/firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
SHOULD_NOT_OVERRIDE(TRUE)
PRIVATE_PROC(TRUE) // only base of /start_firing_cycle is allowed to call us
@@ -66,84 +74,60 @@
* If this is ever violated bad things may happen and things may explode.
*/
- firing_cycle = cycle_id
-
- var/interrupted = FALSE
-
- on_firing_cycle_start(firer, angle, firing_flags, firemode, target, actor)
-
- var/iterations
- var/iterations_fired = 0
- var/iteration_delay
- var/last_firing_result
-
- #warn impl stuff
-
- for(var/iteration in 1 to iterations)
- last_firing_result = fire(firer, angle, firing_flags, firemode, iteration, target, actor)
-
- switch(last_firing_result)
- if(GUN_FIRED_SUCCESS)
- iterations_fired++
-
- if(!post_fire(firer, angle, firing_flags, firemode, iteration, last_firing_result, target, actor))
+ // create cycle
+ var/datum/gun_firing_cycle/our_cycle = new
+ our_cycle.firing_flags = firing_flags
+ our_cycle.original_angle = angle
+ our_cycle.original_target = target
+ our_cycle.firemode = firemode
+ our_cycle.firing_actor = actor
+ our_cycle.firing_atom = firer
+ our_cycle.firing_iterations = firemode.burst_amount
+ our_cycle.firing_delay = firemode.burst_delay
+ // cycle notch
+ our_cycle.cycle_notch = ++firing_cycle_next
+ if(firing_cycle_next >= SHORT_REAL_LIMIT)
+ firing_cycle_next = -(SHORT_REAL_LIMIT - 1)
+ // record start
+ our_cycle.cycle_start_time = world.time
+ // begin
+ firing_cycle = our_cycle
+ on_firing_cycle_start(our_cycle)
+
+ var/safety = 50
+ var/iteration = 0
+ while(iteration < our_cycle.firing_iterations)
+ ++iteration
+ --safety
+ if(safety <= 0)
+ CRASH("safety ran out during firing cycle")
+ our_cycle.last_firing_result = fire(cycle)
+ if(!post_fire(cycle))
break
-
if(iteration != iterations)
sleep(iteration_delay)
- if(firing_cycle != cycle_id)
- interrupted = TRUE
+ if(firing_cycle != our_cycle)
+ our_cycle.last_interrupted = TRUE
break
- on_firing_cycle_end(firer, angle, firing_flags, firemode, target, actor, iterations_fired, last_firing_result)
+ on_firing_cycle_end(our_cycle)
+ return our_cycle
//* Firing *//
-/**
- * called to perform a single firing operation
- *
- * @params
- * * firer - the thing physically firing us; whether a turret or a person
- * * angle - the angle to fire in.
- * * firing_flags - GUN_FIRING_* flags
- * * firemode - the /datum/firemode we are firing on
- * * iteration - burst iteration; for single-firing, this is always 1.
- * * target - (optional) what we're firing at
- * * actor - (optional) the person who initiated the firing
- */
-/obj/item/gun/proc/fire(atom/firer, angle, firing_flags, datum/firemode/firemode, iteration, atom/target, datum/event_args/actor/actor)
- SHOULD_NOT_SLEEP(TRUE)
- #warn impl; check unmount
-
- // todo: sigh
- var/held_twohanded = TRUE
- if(ismob(user))
- var/mob/mob_firer = firer
- held_twohanded = mob_firer.can_wield_item(src) && is_held_twohanded(mob_firer)
-
- // point of no return
- var/obj/projectile/firing_projectile = consume_next_projectile(iteration, firing_flags, firemode, actor, firer)
- if(!istype(firing_projectile))
- // it's an error code if it's not real
- return firing_projectile
-
- // todo: do we really need to newtonian move always?
- if(ismovable(firer))
- var/atom/movable/movable_firer = firer
- movable_firer.newtonian_move(angle2dir(angle))
-
/**
* Called to handle post fire
*
* @return FALSE to abort firing cycle
*/
-/obj/item/gun/proc/post_fire(atom/firer, angle, firing_flags, datum/firemode/firemode, iteration, firing_result, atom/target, datum/event_args/actor/actor)
+/obj/item/gun/proc/post_fire(datum/gun_firing_cycle/cycle)
SHOULD_NOT_SLEEP(TRUE)
- switch(firing_result)
+ switch(cycle.last_firing_result)
if(GUN_FIRED_SUCCESS)
+ cycle.cycle_iterations_fired++
return TRUE
if(GUN_FIRED_FAIL_EMPTY, GUN_FIRED_FAIL_INERT)
- post_empty_fire(firing_flags, actor, target)
+ return post_empty_fire(cycle)
else
return FALSE
@@ -152,19 +136,16 @@
/**
* Called if someone tries to fire us without live ammo in the chamber (or chamber-equivalent)
*
- * @params
- * * firing_flags - our firing flags
- * * actor - (optional) the actor tuple describing who's firing us, if any.
- * * target - (optional) what we were being fired at
+ * @return FALSE to abort firing cycle.
*/
-/obj/item/gun/proc/post_empty_fire(firing_flags, datum/event_args/actor/actor, atom/target)
+/obj/item/gun/proc/post_empty_fire(datum/gun_firing_cycle/cycle)
if(!(firing_flags & GUN_FIRING_NO_CLICK_EMPTY))
// default click empty
- default_click_empty()
- #warn impl
+ default_click_empty(cycle)
+ return FALSE
// todo: actor / event_args support
-/obj/item/gun/proc/default_click_empty()
+/obj/item/gun/proc/default_click_empty(datum/gun_firing_cycle/cycle)
var/mob/holding_us = worn_mob()
if(holding_us)
holding_us.visible_message(SPAN_WARNING("*click click*"), SPAN_WARNING("*click*"))
diff --git a/code/modules/projectiles/guns/gun-modular.dm b/code/modules/projectiles/guns/gun-modular.dm
index ee9e0ef97776..67c7e7fc73b0 100644
--- a/code/modules/projectiles/guns/gun-modular.dm
+++ b/code/modules/projectiles/guns/gun-modular.dm
@@ -32,3 +32,26 @@
#warn impl
#warn hook everything in attackby's
+
+//* Modular Components - API *//
+
+/**
+ * Try to use a certain amount of power.
+ *
+ * @return amount used
+ */
+/obj/item/gun/proc/modular_use_power(obj/item/gun_component/component, joules)
+ return 0
+
+/**
+ * Try to use a certain amount of power. Fails if insufficient.
+ *
+ * @params
+ * * component - the component drawing power
+ * * joules - how much power to use, in joules
+ * * reserve - how many joules must be remaining after use, in joules
+ *
+ * @return amount used
+ */
+/obj/item/gun/proc/modular_use_checked_power(obj/item/gun_component/component, joules, reserve)
+ return 0
diff --git a/code/modules/projectiles/guns/gun-projectile-implementation.dm b/code/modules/projectiles/guns/gun-projectile-implementation.dm
index 7110405ea3b8..f8630f158703 100644
--- a/code/modules/projectiles/guns/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/guns/gun-projectile-implementation.dm
@@ -10,10 +10,34 @@
* this way we have separation between behaviors only needed on guns that shoot
* /obj/projectile's. that said, this is a little annoying to do (path length bloat)
* so for now we put the projectile procs in their own file.
- *
- * maybe we won't do it after all due to path length bloat but the current method definitely just sucks.
*/
+/**
+ * called to perform a single firing operation
+ */
+/obj/item/gun/proc/fire(datum/gun_firing_cycle/cycle)
+ SHOULD_NOT_SLEEP(TRUE)
+ #warn impl; check unmount
+
+ // handle legacy systems
+ var/held_twohanded = TRUE
+ if(ismob(cycle.firing_atom))
+ var/mob/mob_firer = cycle.firing_atom
+ // todo: proper twohanding system
+ held_twohanded = mob_firer.can_wield_item(src) && is_held_twohanded(mob_firer)
+ mob_firer.break_cloak()
+
+ // point of no return
+ var/obj/projectile/firing_projectile = consume_next_projectile(iteration, firing_flags, firemode, actor, firer)
+ if(!istype(firing_projectile))
+ // it's an error code if it's not real
+ return firing_projectile
+
+ // todo: do we really need to newtonian move always?
+ if(ismovable(firer))
+ var/atom/movable/movable_firer = firer
+ movable_firer.newtonian_move(angle2dir(angle))
+
/**
* Obtains the next projectile to fire.
*
@@ -24,15 +48,8 @@
* * Things like 'the next bullet is empty so we fail' go in here
* * This should be called *as* the point of no return. This has side effects.
* * Everything is optional here. Things like portable turrets reserve the right to 'pull' from the gun without caring about params.
- *
- * @params
- * * iteration - (optional) the iteration of the fire
- * * firing_flags - (optional) GUN_FIRING_* flags
- * * firemode - (optional) the firemode
- * * actor - (optional) the initiator
- * * firer - (optional) the actual firer
*/
-/obj/item/gun/proc/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/proc/consume_next_projectile(datum/gun_firing_cycle/cycle)
. = GUN_FIRED_FAIL_UNKNOWN
// todo: on base /gun/projectile?
CRASH("attempted to process next projectile on base /gun")
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 9e6f4314dbe6..d0d50a0dbffe 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -9,6 +9,13 @@
var/name = "default"
var/list/settings = list()
+ //* firing *//
+ /// number of shots in burst
+ var/burst_amount = 1
+ /// delay between burst shots
+ var/burst_delay = 0.2 SECONDS
+
+ //* rendering *//
/// state key for rendering, if any
var/render_key
@@ -26,6 +33,8 @@
else
settings[propname] = propvalue
+ #warn automatically pull burst amount/delay from list and set
+
/datum/firemode/proc/apply_to(obj/item/gun/gun)
for(var/propname in settings)
gun.vars[propname] = settings[propname]
@@ -74,7 +83,7 @@
/// the current firing cycle
///
/// * to interrupt a firing cycle, just change it.
- var/tmp/firing_cycle
+ var/tmp/datum/gun_firing_cycle/firing_cycle
/// the next firing cycle
///
/// * static var; technically can collide. realistically, won't.
@@ -492,12 +501,6 @@
/obj/item/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0)
SHOULD_NOT_OVERRIDE(TRUE)
- if(!user || !target) return
- if(target.z != user.z) return
-
- add_fingerprint(user)
-
- user.break_cloak()
if(!special_check(user))
return
@@ -577,89 +580,6 @@
else
set_light(0)
-// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
-/obj/item/gun/proc/Fire_userless(atom/target)
- SHOULD_NOT_OVERRIDE(TRUE)
- if(!target)
- return
-
- if(world.time < next_fire_time)
- return
-
- var/shoot_time = (burst - 1)* burst_delay
- next_fire_time = world.time + shoot_time
-
- var/turf/targloc = get_turf(target) //cache this in case target gets deleted during shooting, e.g. if it was a securitron that got destroyed.
- for(var/i in 1 to burst)
- var/obj/projectile = consume_next_projectile()
- if(!projectile)
- handle_click_empty()
- break
-
- if(istype(projectile, /obj/projectile))
- var/obj/projectile/P = projectile
-
- var/acc = burst_accuracy[min(i, burst_accuracy.len)]
- var/disp = dispersion[min(i, dispersion.len)]
-
- P.accuracy_overall_modify *= 1 + acc / 100
- P.dispersion = disp
-
- P.shot_from = src.name
- P.silenced = silenced
-
- P.old_style_target(target)
- play_fire_sound(P = projectile)
- P.fire()
-
- last_shot = world.time
-
- if(muzzle_flash)
- set_light(muzzle_flash)
- update_icon()
-
- //process_accuracy(projectile, user, target, acc, disp)
-
- // if(pointblank)
- // process_point_blank(projectile, user, target)
-
- // if(process_projectile(projectile, null, target, user.zone_sel.selecting, clickparams))
- // handle_post_fire(null, target, pointblank, reflex)
-
- // update_icon()
-
- if(i < burst)
- sleep(burst_delay)
-
- if(!(target && target.loc))
- target = targloc
- //pointblank = 0
-
- var/target_for_log
- if(ismob(target))
- target_for_log = target
- else
- target_for_log = "[target.name]"
-
- add_attack_logs("Unmanned",target_for_log,"Fired [src.name]")
-
- //update timing
- next_fire_time = world.time + fire_delay
-
- accuracy = initial(accuracy) //Reset the gun's accuracy
-
- if(muzzle_flash)
- set_light(0)
-
-//used by aiming code
-/obj/item/gun/proc/can_hit(atom/target as mob, var/mob/living/user as mob)
- if(!special_check(user))
- return 2
- //just assume we can shoot through glass and stuff. No big deal, the player can just choose to not target someone
- //on the other side of a window if it makes a difference. Or if they run behind a window, too bad.
- if(check_trajectory(target, user))
- return 1 // Magic numbers are fun.
-
/obj/item/gun/proc/handle_click_safety(mob/user)
user.visible_message(SPAN_WARNING("[user] squeezes the trigger of \the [src] but it doesn't move!"), SPAN_WARNING("You squeeze the trigger but it doesn't move!"), range = MESSAGE_RANGE_COMBAT_SILENCED)
diff --git a/code/modules/projectiles/guns/gun_firing_cycle.dm b/code/modules/projectiles/guns/gun_firing_cycle.dm
new file mode 100644
index 000000000000..7e137c849321
--- /dev/null
+++ b/code/modules/projectiles/guns/gun_firing_cycle.dm
@@ -0,0 +1,50 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/datum/gun_firing_cycle
+ //* cycle *//
+ /// our firing cycle id - integer
+ var/cycle_notch
+ /// start world.time
+ var/cycle_start_time
+ /// iterations so far fired
+ var/cycle_iterations_fired = 0
+
+ //* targeting *//
+ /// original target
+ var/atom/original_target
+ /// original angle
+ var/original_angle
+
+ //* firemode *//
+ /// firemode: the original /datum/firemode we're firing on
+ var/datum/firemode/firemode
+
+ //* firing *//
+ /// firing flags
+ var/firing_flags
+ /// firing atom
+ ///
+ /// * this is not the same as actor event args; most things that care about this
+ /// do not care about the actor tuple.
+ var/atom/firing_atom
+ /// actor tuple, if it exists.
+ var/datum/event_args/actor/firing_actor
+ /// how many iterations to fire
+ ///
+ /// * defaulted to firemode settings
+ var/firing_iterations = 1
+ /// delay between firing iterations
+ ///
+ /// * defaulted to firemode settings
+ var/firing_delay = 0.2 SECONDS
+
+ //* fired processing args *//
+ //* these are vars set in a given iteration of firing. *//
+ /// last GUN_FIRED_* result
+ var/last_firing_result
+ /// were we interrupted?
+ var/last_interrupted = FALSE
+
+ //* firing modifier args *//
+ //* this is where things like modular gun components will inject into. *//
diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm
index 9633fab89d2c..17cae1b6b70f 100644
--- a/code/modules/projectiles/guns/magic.dm
+++ b/code/modules/projectiles/guns/magic.dm
@@ -56,7 +56,7 @@
charge_tick = 0
charges++
-/obj/item/gun/magic/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/magic/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(charges <= 0)
return null
return chambered?.get_projectile()
diff --git a/code/modules/projectiles/guns/magnetic.dm b/code/modules/projectiles/guns/magnetic.dm
index 0125fd877b3a..be49ad8405f5 100644
--- a/code/modules/projectiles/guns/magnetic.dm
+++ b/code/modules/projectiles/guns/magnetic.dm
@@ -165,7 +165,7 @@
qdel(loaded)
loaded = null
-/obj/item/gun/magnetic/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/magnetic/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
@@ -206,7 +206,7 @@
capacitor = new /obj/item/stock_parts/capacitor
return ..()
-/obj/item/gun/magnetic/fuelrod/consume_next_projectile(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
+/obj/item/gun/magnetic/fuelrod/consume_next_projectile(datum/gun_firing_cycle/cycle)
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
From 72b2b6557fb5c215aee27f275b64e7fa98d1c1a7 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 19:06:33 +0000
Subject: [PATCH 43/68] that
---
code/__HELPERS/math/angle.dm | 9 ++++++
code/__HELPERS/math/distance.dm | 16 ++++++----
code/__HELPERS/pathfinding/astar.dm | 2 +-
code/__HELPERS/pathfinding/jps.dm | 2 +-
.../mapping/spatial_helpers/distance.dm | 3 +-
.../subtypes/manipulation.dm | 3 +-
.../mining/tools/kinetic_accelerator.dm | 2 +-
.../projectiles/guns/ballistic/automatic.dm | 8 ++---
.../projectiles/guns/ballistic/contender.dm | 6 ----
.../projectiles/guns/ballistic/pistol.dm | 15 ++-------
.../projectiles/guns/ballistic/rocket.dm | 14 ++-------
.../projectiles/guns/ballistic/shotgun.dm | 3 +-
.../projectiles/guns/energy/special.dm | 4 ++-
code/modules/projectiles/guns/gun-firing.dm | 31 +++++++++++++------
code/modules/projectiles/guns/gun-modular.dm | 2 +-
.../guns/gun-projectile-implementation.dm | 8 ++---
code/modules/projectiles/guns/launcher.dm | 2 ++
.../projectiles/guns/launcher/crossbow.dm | 13 +++++---
.../guns/launcher/grenade_launcher.dm | 5 ---
.../projectiles/guns/launcher/pneumatic.dm | 6 ++--
.../projectiles/guns/launcher/syringe_gun.dm | 10 ++----
21 files changed, 81 insertions(+), 83 deletions(-)
diff --git a/code/__HELPERS/math/angle.dm b/code/__HELPERS/math/angle.dm
index 3ba3ce9e7cf7..5e3877aff460 100644
--- a/code/__HELPERS/math/angle.dm
+++ b/code/__HELPERS/math/angle.dm
@@ -52,3 +52,12 @@
. += 180
else if(x < 0)
. += 360
+
+/**
+ * get angle from center of bounding box of entity A to entity B
+ */
+/proc/get_centered_entity_angle(atom/A, atom/B)
+ var/dy
+ var/dx
+ return arctan()
+#warn this
diff --git a/code/__HELPERS/math/distance.dm b/code/__HELPERS/math/distance.dm
index 34841d447aa1..73df0acb6861 100644
--- a/code/__HELPERS/math/distance.dm
+++ b/code/__HELPERS/math/distance.dm
@@ -1,11 +1,15 @@
/**
* checks distance from one thing to another but automatically resolving for turf / nesting
+ *
+ * todo: re-evaluate
*/
/proc/in_range_of(atom/A, atom/B, dist = 1)
return game_range_to(A, B) <= dist
/**
* gets real dist from A to B, including resolving for turf. if not the same Z, returns infinity.
+ *
+ * todo: this is silly, redo?
*/
/proc/game_range_to(atom/A, atom/B)
A = get_turf(A)
@@ -15,23 +19,23 @@
/**
* real dist because byond dist doesn't go above 127 :/
*
- * accepts **TURFS**
+ * * Only accepts **turfs**. Undefined behavior if inputs are not turfs.
*/
-/proc/get_chebyshev_dist(turf/A, turf/B)
+/proc/get_turf_chebyshev_dist(turf/A, turf/B)
return max(abs(A.x - B.x), abs(A.y - B.y))
/**
* real euclidean dist
*
- * accepts **TURFS**
+ * * Only accepts **turfs**. Undefined behavior if inputs are not turfs.
*/
-/proc/get_euclidean_dist(turf/A, turf/B)
+/proc/get_turf_euclidean_dist(turf/A, turf/B)
return sqrt((A.x - B.x) ** 2 + (A.y - B.y) ** 2)
/**
* real taxicab dist
*
- * accepts **TURFS**
+ * * Only accepts **turfs**. Undefined behavior if inputs are not turfs.
*/
-/proc/get_manhattan_dist(turf/A, turf/B)
+/proc/get_turf_manhattan_dist(turf/A, turf/B)
return abs(A.x - B.x) + abs(A.y - B.y)
diff --git a/code/__HELPERS/pathfinding/astar.dm b/code/__HELPERS/pathfinding/astar.dm
index 6120807366c1..8d64733f3e7f 100644
--- a/code/__HELPERS/pathfinding/astar.dm
+++ b/code/__HELPERS/pathfinding/astar.dm
@@ -146,7 +146,7 @@ GLOBAL_VAR_INIT(astar_visualization_persist, 3 SECONDS)
if(src.start == src.goal)
return list()
// too far away
- if(get_manhattan_dist(src.start, src.goal) > max_path_length)
+ if(get_turf_manhattan_dist(src.start, src.goal) > max_path_length)
return null
#ifdef ASTAR_DEBUGGING
var/list/turf/turfs_got_colored = list()
diff --git a/code/__HELPERS/pathfinding/jps.dm b/code/__HELPERS/pathfinding/jps.dm
index e90dcc6770d0..7d053e5fa63e 100644
--- a/code/__HELPERS/pathfinding/jps.dm
+++ b/code/__HELPERS/pathfinding/jps.dm
@@ -112,7 +112,7 @@ GLOBAL_VAR_INIT(jps_visualization_resolve, TRUE)
if(src.start == src.goal)
return list()
// too far away
- if(get_chebyshev_dist(src.start, src.goal) > max_path_length)
+ if(get_turf_chebyshev_dist(src.start, src.goal) > max_path_length)
return null
#ifdef JPS_DEBUGGING
//* set up debugging vars
diff --git a/code/controllers/subsystem/mapping/spatial_helpers/distance.dm b/code/controllers/subsystem/mapping/spatial_helpers/distance.dm
index 6a6ea0d5c9b8..fc7a6fdf0ac6 100644
--- a/code/controllers/subsystem/mapping/spatial_helpers/distance.dm
+++ b/code/controllers/subsystem/mapping/spatial_helpers/distance.dm
@@ -15,7 +15,8 @@
*/
/datum/controller/subsystem/mapping/proc/get_virtual_dist(turf/A, turf/B, z_dist)
// todo: get_dist after 515
- return get_manhattan_dist(A, B)
+ // todo: redo this proc / split into multiple; manhattan distance isn't what byond uses
+ return get_turf_manhattan_dist(A, B)
// A = get_turf(A)
// B = get_turf(B)
// if(A.z == B.z)
diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm
index 1853251f7c19..059eb5c857c7 100644
--- a/code/modules/integrated_electronics/subtypes/manipulation.dm
+++ b/code/modules/integrated_electronics/subtypes/manipulation.dm
@@ -916,8 +916,7 @@
if(!T)
return
- installed_gun.Fire_userless(T)
-
+ installed_gun.start_firing_cycle_async(assembly, get_centered_entity_angle(assembly, T))
/obj/item/integrated_circuit/manipulation/grenade
name = "grenade primer"
diff --git a/code/modules/mining/tools/kinetic_accelerator.dm b/code/modules/mining/tools/kinetic_accelerator.dm
index 7d491e1392d9..afc196f32422 100644
--- a/code/modules/mining/tools/kinetic_accelerator.dm
+++ b/code/modules/mining/tools/kinetic_accelerator.dm
@@ -48,7 +48,7 @@
var/obj/projectile/P = .
modify_projectile(P)
-/obj/item/gun/energy/kinetic_accelerator/handle_post_fire(mob/user, atom/target, pointblank, reflex)
+/obj/item/gun/energy/kinetic_accelerator/on_firing_cycle_end(datum/gun_firing_cycle/cycle)
. = ..()
attempt_reload()
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 4cdf03148e99..9d2ed135692e 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -172,13 +172,13 @@
else
..()
-/obj/item/gun/ballistic/automatic/z8/Fire(atom/target, mob/living/user, params, pointblank=0, reflex=0)
+/obj/item/gun/ballistic/automatic/z8/fire(datum/gun_firing_cycle/cycle)
if(use_launcher)
- launcher.Fire(target, user, params, pointblank, reflex)
+ launcher.fire(cycle)
if(!launcher.chambered)
switch_firemodes(user) //switch back automatically
- else
- ..()
+ return GUN_FIRED_SUCCESS
+ return ..()
/obj/item/gun/ballistic/automatic/z8/update_icon_state()
. = ..()
diff --git a/code/modules/projectiles/guns/ballistic/contender.dm b/code/modules/projectiles/guns/ballistic/contender.dm
index e0fa902a58d0..09eeed5dd70e 100644
--- a/code/modules/projectiles/guns/ballistic/contender.dm
+++ b/code/modules/projectiles/guns/ballistic/contender.dm
@@ -120,12 +120,6 @@
if(destroyed)
return GUN_FIRED_FAIL_INERT
-/obj/item/gun/ballistic/contender/pipegun/Fire(atom/target, mob/living/user, clickparams, pointblank, reflex)
- . = ..()
- if(destroyed)
- to_chat(user, "\The [src] is completely inoperable!")
- handle_click_empty()
-
/obj/item/gun/ballistic/contender/pipegun/attack_hand(mob/user, datum/event_args/actor/clickchain/e_args)
if(user.get_inactive_held_item() == src && destroyed)
to_chat(user, "\The [src]'s chamber is too warped to extract the casing!")
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index f89cf912e32a..7ee9928066db 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -266,12 +266,6 @@
if(destroyed)
return
-/obj/item/gun/ballistic/pirate/Fire(atom/target, mob/living/user, clickparams, pointblank, reflex)
- . = ..()
- if(destroyed)
- to_chat(user, "\The [src] is completely inoperable!")
- handle_click_empty()
-
/obj/item/gun/ballistic/pirate/attack_hand(mob/user, datum/event_args/actor/clickchain/e_args)
if(user.get_inactive_held_item() == src && destroyed)
to_chat(user, "\The [src]'s chamber is too warped to extract the casing!")
@@ -408,13 +402,10 @@
else
..()
-/obj/item/gun/ballistic/konigin/Fire(atom/target, mob/living/user, params, pointblank=0, reflex=0)
+/obj/item/gun/ballistic/konigin/fire(datum/gun_firing_cycle/cycle)
if(use_shotgun)
- shotgun.Fire(target, user, params, pointblank, reflex)
- //if(!shotgun.chambered)
- //switch_firemodes(user) //switch back automatically
- else
- ..()
+ return shotgun.fire(cycle)
+ return ..()
/* Having issues with getting this to work atm.
/obj/item/gun/ballistic/konigin/examine(mob/user, dist)
diff --git a/code/modules/projectiles/guns/ballistic/rocket.dm b/code/modules/projectiles/guns/ballistic/rocket.dm
index 85d19e6e27d3..d4dcfa4e1642 100644
--- a/code/modules/projectiles/guns/ballistic/rocket.dm
+++ b/code/modules/projectiles/guns/ballistic/rocket.dm
@@ -149,19 +149,9 @@
destroyed = 1
name = "broken rokkit launcher"
desc = "The tube has burst outwards like a sausage."
- return
+ return null
if(21 to 100)
- return 1
-
- if(destroyed)
- handle_click_empty()
- return
-
-/obj/item/gun/ballistic/rocket/tyrmalin/Fire(atom/target, mob/living/user, clickparams, pointblank, reflex)
- . = ..()
- if(destroyed)
- to_chat(user, "\The [src] is completely inoperable!")
- handle_click_empty()
+ return ..()
/obj/item/gun/ballistic/rocket/tyrmalin/attack_hand(mob/user, datum/event_args/actor/clickchain/e_args)
if(user.get_inactive_held_item() == src && destroyed)
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index f0ded91bb67d..f616e5b0d665 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -190,8 +190,9 @@
if(loaded.len)
var/burstsetting = burst
burst = 2
+ // todo: what happens if it's inside a container?
user.visible_message("The shotgun goes off!", "The shotgun goes off in your face!")
- Fire_userless(user)
+ start_firing_cycle_async(src, rand(0, 360))
burst = burstsetting
return
if(do_after(user, 30)) //SHIT IS STEALTHY EYYYYY
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index dffe99e564d6..f9ee055ab29b 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -293,7 +293,9 @@
else
if(beameffect)
qdel(beameffect)
- post_empty_fire(actor = new /datum/event_args/actor(user))
+ var/datum/gun_firing_cycle/cycle = new
+ cycle.firing_actor = new /datum/event_args/actor(user)
+ post_empty_fire(cycle)
power_cycle = FALSE
else
to_chat(user, "\The [src] is already powering up!")
diff --git a/code/modules/projectiles/guns/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
index a0e0e6ca538b..b403d0ec04c8 100644
--- a/code/modules/projectiles/guns/gun-firing.dm
+++ b/code/modules/projectiles/guns/gun-firing.dm
@@ -6,9 +6,14 @@
/**
* async proc to start a firing cycle
*
+ * * firer is where the will actually come out of.
+ * * if firer is a turf, projectile is centered on turf
+ * * if firer is a mob, we use its calculations for that depending on how we're held
+ * * if firer is ourselves, projectile comes out of us. this is implementation defined.
+ *
* @return firing cycle datum
*/
-/obj/item/gun/proc/async_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
+/obj/item/gun/proc/start_firing_cycle_async(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
SHOULD_CALL_PARENT(TRUE)
SHOULD_NOT_SLEEP(TRUE)
@@ -21,10 +26,14 @@
/**
* starts, and blocks on a firing cycle
+ *
+ * * firer is where the will actually come out of.
+ * * if firer is a turf, projectile is centered on turf
+ * * if firer is a mob, we use its calculations for that depending on how we're held
+ * * if firer is ourselves, projectile comes out of us. this is implementation defined.
*/
-/obj/item/gun/proc/blocking_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
+/obj/item/gun/proc/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
SHOULD_CALL_PARENT(TRUE)
- SHOULD_NOT_SLEEP(TRUE)
return firing_cycle(firer, angle, firing_flags, firemode, target, actor)
@@ -35,7 +44,7 @@
SHOULD_NOT_SLEEP(TRUE)
SHOULD_NOT_OVERRIDE(TRUE)
- if(cycle_id && firing_cycle?.notch != cycle_id)
+ if(cycle_id && firing_cycle?.cycle_notch != cycle_id)
return
firing_cycle = null
@@ -56,7 +65,7 @@
*
* @params
* * firer - the thing physically firing us; whether a turret or a person.
- * this is where the projectile will originate, not the physical location of the gun.
+ * this is where the projectile will originate regardles of where the gun actually is!
* * angle - the angle to fire in.
* * firing_flags - GUN_FIRING_* flags
* * firemode - (optional) the /datum/firemode we are firing on
@@ -73,6 +82,8 @@
* As a word of warning, any proc called in this proc must be SHOULD_NOT_SLEEP.
* If this is ever violated bad things may happen and things may explode.
*/
+ #warn logging
+ #warn default firemode
// create cycle
var/datum/gun_firing_cycle/our_cycle = new
@@ -101,11 +112,11 @@
--safety
if(safety <= 0)
CRASH("safety ran out during firing cycle")
- our_cycle.last_firing_result = fire(cycle)
- if(!post_fire(cycle))
+ our_cycle.last_firing_result = fire(our_cycle)
+ if(!post_fire(our_cycle))
break
- if(iteration != iterations)
- sleep(iteration_delay)
+ if(iteration != our_cycle.firing_iterations)
+ sleep(our_cycle.firing_delay)
if(firing_cycle != our_cycle)
our_cycle.last_interrupted = TRUE
break
@@ -139,7 +150,7 @@
* @return FALSE to abort firing cycle.
*/
/obj/item/gun/proc/post_empty_fire(datum/gun_firing_cycle/cycle)
- if(!(firing_flags & GUN_FIRING_NO_CLICK_EMPTY))
+ if(!(cycle.firing_flags & GUN_FIRING_NO_CLICK_EMPTY))
// default click empty
default_click_empty(cycle)
return FALSE
diff --git a/code/modules/projectiles/guns/gun-modular.dm b/code/modules/projectiles/guns/gun-modular.dm
index 67c7e7fc73b0..65ef223a8d9c 100644
--- a/code/modules/projectiles/guns/gun-modular.dm
+++ b/code/modules/projectiles/guns/gun-modular.dm
@@ -34,7 +34,7 @@
#warn hook everything in attackby's
//* Modular Components - API *//
-
+
/**
* Try to use a certain amount of power.
*
diff --git a/code/modules/projectiles/guns/gun-projectile-implementation.dm b/code/modules/projectiles/guns/gun-projectile-implementation.dm
index f8630f158703..18397f3b2794 100644
--- a/code/modules/projectiles/guns/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/guns/gun-projectile-implementation.dm
@@ -28,15 +28,15 @@
mob_firer.break_cloak()
// point of no return
- var/obj/projectile/firing_projectile = consume_next_projectile(iteration, firing_flags, firemode, actor, firer)
+ var/obj/projectile/firing_projectile = consume_next_projectile(cycle)
if(!istype(firing_projectile))
// it's an error code if it's not real
return firing_projectile
// todo: do we really need to newtonian move always?
- if(ismovable(firer))
- var/atom/movable/movable_firer = firer
- movable_firer.newtonian_move(angle2dir(angle))
+ if(ismovable(cycle.firing_atom))
+ var/atom/movable/movable_firer = cycle.firing_atom
+ movable_firer.newtonian_move(angle2dir(cycle.original_angle))
/**
* Obtains the next projectile to fire.
diff --git a/code/modules/projectiles/guns/launcher.dm b/code/modules/projectiles/guns/launcher.dm
index 54f5de5daf75..ff7a8e4baa31 100644
--- a/code/modules/projectiles/guns/launcher.dm
+++ b/code/modules/projectiles/guns/launcher.dm
@@ -24,6 +24,8 @@
/**
* Returns the next /atom/movable to throw, or a GUN_FIRED_* for fail satus.
+ *
+ * * This should clear the throwable from our references.
*/
/obj/item/gun/launcher/proc/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
. = GUN_FIRED_FAIL_UNKNOWN
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index e935c19ed825..4fb4a2505a77 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -76,17 +76,20 @@
SPAN_WARNING("The bolt on [src] isn't drawn back!"),
target = src,
)
- return
+ return FALSE
return ..()
/obj/item/gun/launcher/crossbow/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
- return bolt
-
-/obj/item/gun/launcher/crossbow/handle_post_fire(mob/user, atom/target)
+ . = bolt
bolt = null
+
+/obj/item/gun/launcher/crossbow/post_fire(datum/gun_firing_cycle/cycle)
+ . = ..()
tension = 0
+
+/obj/item/gun/launcher/crossbow/on_firing_cycle_end(datum/gun_firing_cycle/cycle)
+ . = ..()
update_icon()
- ..()
/obj/item/gun/launcher/crossbow/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
diff --git a/code/modules/projectiles/guns/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
index 23e56c7dbe6b..5f6021227c37 100644
--- a/code/modules/projectiles/guns/launcher/grenade_launcher.dm
+++ b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
@@ -83,11 +83,6 @@
else
..()
-/obj/item/gun/launcher/grenade/handle_post_fire(mob/user)
- message_admins("[key_name_admin(user)] fired a grenade ([chambered.name]) from a grenade launcher ([src.name]).")
- log_game("[key_name_admin(user)] used a grenade ([chambered.name]).")
- chambered = null
-
//Underslung grenade launcher to be used with the Z8
/obj/item/gun/launcher/grenade/underslung
name = "underslung grenade launcher"
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index 6d9372728511..e32c6c47b9f8 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -122,14 +122,14 @@
else
release_force = 0
-/obj/item/gun/launcher/pneumatic/handle_post_fire()
+/obj/item/gun/launcher/pneumatic/post_fire(datum/gun_firing_cycle/cycle)
+ . = ..()
if(tank)
var/lost_gas_amount = tank.air_contents.total_moles*(pressure_setting/100)
var/datum/gas_mixture/removed = tank.air_contents.remove(lost_gas_amount)
var/turf/T = get_turf(src.loc)
- if(T) T.assume_air(removed)
- ..()
+ T?.assume_air(removed)
/obj/item/gun/launcher/pneumatic/update_icon()
. = ..()
diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm
index 3b51f67f28c7..f4be4ac40cb9 100644
--- a/code/modules/projectiles/guns/launcher/syringe_gun.dm
+++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm
@@ -87,13 +87,9 @@
/obj/item/gun/launcher/syringe/consume_next_throwable(iteration, firing_flags, datum/firemode/firemode, datum/event_args/actor/actor, atom/firer)
if(next)
next.prime()
- return next
- return null
-
-/obj/item/gun/launcher/syringe/handle_post_fire()
- ..()
- darts -= next
- next = null
+ . = next
+ darts -= next
+ next = null
/obj/item/gun/launcher/syringe/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
From 691588e78abbd64593f00196602e666f0c5444c6 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 19:30:42 +0000
Subject: [PATCH 44/68] hell
---
code/game/click/adjacency.dm | 2 +
.../projectiles/guns/ballistic/automatic.dm | 2 +-
code/modules/projectiles/guns/energy.dm | 2 +-
code/modules/projectiles/guns/gun-firing.dm | 11 +++
.../guns/gun-projectile-implementation.dm | 13 +++
code/modules/projectiles/guns/gun.dm | 97 +++++--------------
.../projectiles/guns/gun_firing_cycle.dm | 3 +
.../projectiles/guns/launcher/crossbow.dm | 4 -
8 files changed, 53 insertions(+), 81 deletions(-)
diff --git a/code/game/click/adjacency.dm b/code/game/click/adjacency.dm
index 85fe1660b9c6..7fc903c75cf3 100644
--- a/code/game/click/adjacency.dm
+++ b/code/game/click/adjacency.dm
@@ -6,6 +6,8 @@
*
* **DO NOT** default recursion to on.
*
+ * * This call is basically just one-tile-reach Reachability().
+ *
* @params
* - neighbor - what we're trying to reach
* - recurse - levels we're allowed to recurse up if we're not on a turf
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 9d2ed135692e..2546098b3db2 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -176,7 +176,7 @@
if(use_launcher)
launcher.fire(cycle)
if(!launcher.chambered)
- switch_firemodes(user) //switch back automatically
+ switch_firemodes(cycle.firing_actor?.performer) //switch back automatically
return GUN_FIRED_SUCCESS
return ..()
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 8f919c5f806c..ba107a471c6e 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -48,7 +48,7 @@
/obj/item/gun/energy/process(delta_time)
if(self_recharge) //Every [recharge_time] ticks, recharge a shot for the battery
- if(world.time > last_shot + charge_delay) //Doesn't work if you've fired recently
+ if(world.time > last_fire + charge_delay) //Doesn't work if you've fired recently
if(!obj_cell_slot.cell || obj_cell_slot.cell.charge >= obj_cell_slot.cell.maxcharge)
return 0 // check if we actually need to recharge
diff --git a/code/modules/projectiles/guns/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
index b403d0ec04c8..976e591a737e 100644
--- a/code/modules/projectiles/guns/gun-firing.dm
+++ b/code/modules/projectiles/guns/gun-firing.dm
@@ -34,6 +34,15 @@
*/
/obj/item/gun/proc/start_firing_cycle(atom/firer, angle, firing_flags, datum/firemode/firemode, atom/target, datum/event_args/actor/actor) as /datum/gun_firing_cycle
SHOULD_CALL_PARENT(TRUE)
+ #warn check next fire time / delays; silently fail if there's a cycle ongoing or right after, and give a message if there isn't
+ // if(world.time < next_fire_time)
+ // if (world.time % 3) //to prevent spam
+ // to_chat(user, "[src] is not ready to fire again!")
+
+ //! LEGACY
+ if(!special_check(actor?.performer))
+ return
+ //! END
return firing_cycle(firer, angle, firing_flags, firemode, target, actor)
@@ -59,6 +68,7 @@
*/
/obj/item/gun/proc/on_firing_cycle_end(datum/gun_firing_cycle/cycle)
SHOULD_NOT_SLEEP(TRUE)
+ update_icon()
/**
* called exactly once at the start of a firing cycle to start it
@@ -109,6 +119,7 @@
var/iteration = 0
while(iteration < our_cycle.firing_iterations)
++iteration
+ our_cycle.cycle_iterations_fired = iteration
--safety
if(safety <= 0)
CRASH("safety ran out during firing cycle")
diff --git a/code/modules/projectiles/guns/gun-projectile-implementation.dm b/code/modules/projectiles/guns/gun-projectile-implementation.dm
index 18397f3b2794..d9477f60b172 100644
--- a/code/modules/projectiles/guns/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/guns/gun-projectile-implementation.dm
@@ -33,11 +33,24 @@
// it's an error code if it's not real
return firing_projectile
+ //! LEGACY
+ process_accuracy(firing_projectile, cycle.firing_actor?.performer, cycle.original_target, cycle.cycle_iterations_fired, held_twohanded)
+ // todo: this is ass because if the projectile misses we still get additional damage
+ // todo: Reachability(), not Adjacent().
+ if((cycle.firing_flags & GUN_FIRING_POINT_BLANK) && cycle.original_target && cycle.firing_atom.Adjacent(cycle.original_target))
+ process_point_blank(firing_projectile, cycle.firing_actor?.performer, cycle.original_target)
+ //! END
+
+ // record stuff
+ last_fire = world.time
+
// todo: do we really need to newtonian move always?
if(ismovable(cycle.firing_atom))
var/atom/movable/movable_firer = cycle.firing_atom
movable_firer.newtonian_move(angle2dir(cycle.original_angle))
+ // todo: muzzle flash
+
/**
* Obtains the next projectile to fire.
*
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 16cc7c4836aa..781916d5e8b5 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -15,6 +15,9 @@
/// delay between burst shots
var/burst_delay = 0.2 SECONDS
+ /// delay **after** the firing cycle which we cannot fire
+ var/cooldown = 0.4 SECONDS
+
//* rendering *//
/// state key for rendering, if any
var/render_key
@@ -33,7 +36,7 @@
else
settings[propname] = propvalue
- #warn automatically pull burst amount/delay from list and set
+ #warn automatically pull `burst`, `fire_delay`, `burst_delay` from list and set
/datum/firemode/proc/apply_to(obj/item/gun/gun)
for(var/propname in settings)
@@ -88,12 +91,13 @@
///
/// * static var; technically can collide. realistically, won't.
var/static/firing_cycle_next = 0
+ /// last world.time we fired a shot
+ var/last_fire = 0
+ /// next world.time we can start a firing cycle
+ var/next_fire = 0
// legacy below //
- var/burst = 1
- var/fire_delay = 6 //delay after shooting before the gun can be used again
- var/burst_delay = 2 //delay between shots, if firing in bursts
var/move_delay = 1
var/fire_sound = null // This is handled by projectile.dm's fire_sound var now, but you can override the projectile's fire_sound with this one if you want to.
var/fire_sound_text = "gunshot"
@@ -117,8 +121,6 @@
var/wielded_item_state
var/one_handed_penalty = 0 // Penalty applied if someone fires a two-handed gun with one hand.
var/atom/movable/screen/auto_target/auto_target
- var/shooting = 0
- var/next_fire_time = 0
var/sel_mode = 1 //index of the currently selected mode
var/list/firemodes = list()
@@ -136,8 +138,6 @@
/// whether or not we have safeties and if safeties are on
var/safety_state = GUN_SAFETY_ON
- var/last_shot = 0 //records the last shot fired
-
var/charge_sections = 4
var/shaded_charge = FALSE
var/ammo_x_offset = 2
@@ -424,6 +424,19 @@
if(!user.aiming)
user.aiming = new(user)
+ if(check_safety())
+ //If we are on harm intent (intending to injure someone) but forgot to flick the safety off, there is a 50% chance we
+ //will reflexively do it anyway
+ if(user.a_intent == INTENT_HARM && prob(50))
+ toggle_safety(user)
+ else
+ handle_click_safety(user)
+ return
+
+ if(!user?.client?.get_preference_toggle(/datum/game_preference_toggle/game/help_intent_firing) && user.a_intent == INTENT_HELP)
+ to_chat(user, SPAN_WARNING("You refrain from firing [src] because your intent is set to help!"))
+ return
+
if(user && user.client && user.aiming && user.aiming.active && user.aiming.aiming_at != target)
PreFire(target,user,shitty_legacy_params) //They're using the new gun system, locate what they're aiming at.
return
@@ -502,62 +515,9 @@
/obj/item/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0)
SHOULD_NOT_OVERRIDE(TRUE)
- if(!special_check(user))
- return
-
- if(world.time < next_fire_time)
- if (world.time % 3) //to prevent spam
- to_chat(user, "[src] is not ready to fire again!")
- return
-
- if(check_safety())
- //If we are on harm intent (intending to injure someone) but forgot to flick the safety off, there is a 50% chance we
- //will reflexively do it anyway
- if(user.a_intent == INTENT_HARM && prob(50))
- toggle_safety(user)
- else
- handle_click_safety(user)
- return
-
- if(!user?.client?.get_preference_toggle(/datum/game_preference_toggle/game/help_intent_firing) && user.a_intent == INTENT_HELP)
- to_chat(user, SPAN_WARNING("You refrain from firing [src] because your intent is set to help!"))
- return
-
- var/shoot_time = (burst - 1)* burst_delay
-
- //These should apparently be disabled to allow for the automatic system to function without causing near-permanant paralysis. Re-enabling them while we sort that out.
- user.setClickCooldown(shoot_time) //no clicking on things while shooting
-
- next_fire_time = world.time + shoot_time
-
- //actually attempt to shoot
- var/turf/targloc = get_turf(target) //cache this in case target gets deleted during shooting, e.g. if it was a securitron that got destroyed.
-
for(var/i in 1 to burst)
-
- process_accuracy(projectile, user, target, i, held_twohanded)
-
- if(pointblank)
- process_point_blank(projectile, user, target)
-
+ #warn this
if(process_projectile(projectile, user, target, user.zone_sel.selecting, clickparams))
- handle_post_fire(user, target, pointblank, reflex)
- update_icon()
-
- if(i < burst)
- sleep(burst_delay)
-
- if(!(target && target.loc))
- target = targloc
- pointblank = 0
-
- last_shot = world.time
-
-
- // We do this down here, so we don't get the message if we fire an empty gun.
- if(user.is_holding(src) && user.hands_full())
- if(one_handed_penalty >= 20)
- to_chat(user, "You struggle to keep \the [src] pointed at the correct position with just one hand!")
var/target_for_log
if(ismob(target))
@@ -567,19 +527,6 @@
add_attack_logs(user,target_for_log,"Fired gun [src.name] ([reflex ? "REFLEX" : "MANUAL"])")
- //update timing
- user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
-
- next_fire_time = world.time + fire_delay
-
- accuracy = initial(accuracy) //Reset the gun's accuracyw
-
- if(muzzle_flash)
- if(gun_light)
- set_light(light_brightness)
- else
- set_light(0)
-
/obj/item/gun/proc/handle_click_safety(mob/user)
user.visible_message(SPAN_WARNING("[user] squeezes the trigger of \the [src] but it doesn't move!"), SPAN_WARNING("You squeeze the trigger but it doesn't move!"), range = MESSAGE_RANGE_COMBAT_SILENCED)
diff --git a/code/modules/projectiles/guns/gun_firing_cycle.dm b/code/modules/projectiles/guns/gun_firing_cycle.dm
index 7e137c849321..a6d729d60519 100644
--- a/code/modules/projectiles/guns/gun_firing_cycle.dm
+++ b/code/modules/projectiles/guns/gun_firing_cycle.dm
@@ -8,6 +8,9 @@
/// start world.time
var/cycle_start_time
/// iterations so far fired
+ ///
+ /// * this is set before the fire() call, which means fire() and post_fire()
+ /// can access this for current iteration.
var/cycle_iterations_fired = 0
//* targeting *//
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index 4fb4a2505a77..497dfd6945c7 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -87,10 +87,6 @@
. = ..()
tension = 0
-/obj/item/gun/launcher/crossbow/on_firing_cycle_end(datum/gun_firing_cycle/cycle)
- . = ..()
- update_icon()
-
/obj/item/gun/launcher/crossbow/attack_self(mob/user, datum/event_args/actor/actor)
. = ..()
if(.)
From 7b7ad132c31eab43093075f51c6f950e99c2ff1b Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 21:24:15 +0000
Subject: [PATCH 45/68] updates
---
citadel.dme | 1 +
code/game/click/drag_drop.dm | 6 -
.../nanotrasen/items/guns/nt_pulse.dm | 6 +
code/game/objects/systems/cell_slot.dm | 4 +-
code/modules/power/cell.dm | 4 +-
.../projectiles/guns/ballistic/automatic.dm | 2 -
.../projectiles/guns/ballistic/boltaction.dm | 5 -
.../projectiles/guns/ballistic/contender.dm | 1 -
.../projectiles/guns/ballistic/pistol.dm | 1 -
.../projectiles/guns/ballistic/shotgun.dm | 4 -
.../projectiles/guns/energy/netgun_vr.dm | 2 +-
.../projectiles/guns/energy/particle.dm | 15 ++-
.../projectiles/guns/energy/special.dm | 111 ++++++++----------
code/modules/projectiles/guns/energy/stun.dm | 21 ++--
code/modules/projectiles/guns/firemode.dm | 48 ++++++++
code/modules/projectiles/guns/gun-modular.dm | 17 +--
code/modules/projectiles/guns/gun.dm | 83 ++++---------
.../modules/projectiles/guns/gun_component.dm | 12 +-
.../guns/gun_component/acceleration_coil.dm | 2 +
.../guns/gun_component/active_cooler.dm | 2 +
.../guns/gun_component/energy_handler.dm | 2 +
.../guns/gun_component/internal_module.dm | 2 +
.../guns/gun_component/power_unit.dm | 2 +
.../guns/legacy_vr_guns/custom_guns.dm | 36 +++++-
.../guns/legacy_vr_guns/dominator.dm | 2 +-
.../guns/legacy_vr_guns/protector.dm | 16 +--
.../guns/legacy_vr_guns/secutor.dm | 28 +++--
.../guns/magnetic/magnetic_railgun.dm | 7 --
code/modules/tension/tension.dm | 2 +-
29 files changed, 240 insertions(+), 204 deletions(-)
create mode 100644 code/modules/projectiles/guns/firemode.dm
diff --git a/citadel.dme b/citadel.dme
index a41422642e84..63104200d7b8 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4467,6 +4467,7 @@
#include "code\modules\projectiles\ammunition\calibers\special\rocket.dm"
#include "code\modules\projectiles\guns\ballistic.dm"
#include "code\modules\projectiles\guns\energy.dm"
+#include "code\modules\projectiles\guns\firemode.dm"
#include "code\modules\projectiles\guns\firing_pin.dm"
#include "code\modules\projectiles\guns\gun-firing.dm"
#include "code\modules\projectiles\guns\gun-modular.dm"
diff --git a/code/game/click/drag_drop.dm b/code/game/click/drag_drop.dm
index df676da9a9b1..ccf1fe666abb 100644
--- a/code/game/click/drag_drop.dm
+++ b/code/game/click/drag_drop.dm
@@ -158,12 +158,6 @@
/obj/item
var/canMouseDown = FALSE
-/obj/item/gun
- var/automatic = 0 //can gun use it, 0 is no, anything above 0 is the delay between clicks in ds
-
-/obj/item/gun/CanItemAutoclick(object, location, params)
- . = automatic
-
/atom/proc/IsAutoclickable()
. = 1
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
index 94ce7205f12d..25a94aae0da6 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
@@ -1,7 +1,12 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//
+/datum/firemode/energy/nt_pulse
+ abstract_type = /datum/firemode/energy/nt_pulse
+ cycle_cooldown = 0.4 SECONDS
+
/datum/firemode/energy/nt_pulse/rifle
+ abstract_type = /datum/firemode/energy/nt_pulse/rifle
/datum/firemode/energy/nt_pulse/rifle/laser
name = "laser"
@@ -14,6 +19,7 @@
settings = list(mode_name = "destroy", projectile_type = /obj/projectile/beam/pulse, charge_cost = 180)
/datum/firemode/energy/nt_pulse/carbine
+ abstract_type = /datum/firemode/energy/nt_pulse/carbine
/datum/firemode/energy/nt_pulse/carbine/laser
name = "laser"
diff --git a/code/game/objects/systems/cell_slot.dm b/code/game/objects/systems/cell_slot.dm
index e298cb519a2b..38740bd81c90 100644
--- a/code/game/objects/systems/cell_slot.dm
+++ b/code/game/objects/systems/cell_slot.dm
@@ -199,8 +199,8 @@
* cell function wrapper - checks if the specified amount can be provided. If it can, it removes the amount from the cell and returns TRUE otherwise does nothing and returns FALSE
* returns FALSE if cell is null
*/
-/datum/object_system/cell_slot/proc/checked_use(var/amount)
- return cell?.checked_use(amount) ? TRUE : FALSE
+/datum/object_system/cell_slot/proc/checked_use(amount, reserve)
+ return cell?.checked_use(amount, reserve) ? TRUE : FALSE
/**
* cell function wrapper - use x cell units, affected by GLOB.cellefficiency, returns the amount actually used or 0 if null
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 94d5c9672b84..06b60f18d115 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -128,8 +128,8 @@
// Checks if the specified amount can be provided. If it can, it removes the amount
// from the cell and returns 1. Otherwise does nothing and returns 0.
-/obj/item/cell/proc/checked_use(var/amount)
- if(!check_charge(amount))
+/obj/item/cell/proc/checked_use(amount, reserve)
+ if(!check_charge(amount + reserve))
return 0
use(amount)
return 1
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 2546098b3db2..18ef1db14d42 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -545,13 +545,11 @@
max_shells = 15
burst = 3
fire_delay = 7.2
- move_delay = 6
burst_accuracy = list(60,30,15)
dispersion = list(0.0, 0.6,1.0)
/obj/item/gun/ballistic/automatic/automat/holy
ammo_type = /obj/item/ammo_casing/a7_62mm/silver
- holy = TRUE
/obj/item/gun/ballistic/automatic/automat/taj
name = "Adhomai automat"
diff --git a/code/modules/projectiles/guns/ballistic/boltaction.dm b/code/modules/projectiles/guns/ballistic/boltaction.dm
index 1106d7ea4a3b..49121d84db88 100644
--- a/code/modules/projectiles/guns/ballistic/boltaction.dm
+++ b/code/modules/projectiles/guns/ballistic/boltaction.dm
@@ -30,7 +30,6 @@
name = "blessed bolt-action rifle"
desc = "A bolt-action rifle with a heavy, high-quality wood stock that has a beautiful finish. Clearly not intended to be used in combat. Uses 7.62mm rounds."
ammo_type = /obj/item/ammo_casing/a7_62mm/silver
- holy = TRUE
/obj/item/gun/ballistic/shotgun/pump/rifle/taj
name = "Adhomai bolt action rifle"
@@ -87,7 +86,6 @@
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/holy
name = "blessed lever-action"
ammo_type = /obj/item/ammo_casing/a357/silver
- holy = TRUE
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/attackby(var/obj/item/A as obj, mob/user as mob)
if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/transforming/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != WEIGHT_CLASS_NORMAL)
@@ -131,7 +129,6 @@
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/vintage/holy
name = "blessed lever-action"
ammo_type = /obj/item/ammo_casing/a44/silver
- holy = TRUE
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/vintage/attackby(var/obj/item/A as obj, mob/user as mob)
if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/transforming/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != WEIGHT_CLASS_NORMAL)
@@ -175,7 +172,6 @@
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/arnold/holy
name = "blessed lever-action shotgun"
ammo_type = /obj/item/ammo_casing/a12g/silver
- holy = TRUE
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/win1895
name = "Winchester 1895"
@@ -193,7 +189,6 @@
/obj/item/gun/ballistic/shotgun/pump/rifle/lever/win1895/holy
name = "blessed lever-action"
ammo_type = /obj/item/ammo_casing/a7_62mm/silver
- holy = TRUE
/obj/item/gun/ballistic/shotgun/pump/scopedrifle
name = "scoped bolt action"
diff --git a/code/modules/projectiles/guns/ballistic/contender.dm b/code/modules/projectiles/guns/ballistic/contender.dm
index 09eeed5dd70e..992245916661 100644
--- a/code/modules/projectiles/guns/ballistic/contender.dm
+++ b/code/modules/projectiles/guns/ballistic/contender.dm
@@ -69,7 +69,6 @@
icon_retracted = "pockrifle_c-empty"
ammo_type = /obj/item/ammo_casing/a357/silver
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_OCCULT = 1)
- holy = TRUE
/obj/item/gun/ballistic/contender/holy/a44
caliber = /datum/ammo_caliber/a44
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index 7ee9928066db..3e6418dec61f 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -345,7 +345,6 @@
name = "Blessed Red 9"
desc = "Ah, the choice of an avid gun collector! It's a nice gun, stranger."
ammo_type = /obj/item/ammo_casing/a9mm/silver
- holy = TRUE
/obj/item/gun/ballistic/clown_pistol
name = "clown pistol"
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index f616e5b0d665..bf60aab14051 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -173,7 +173,6 @@
/obj/item/gun/ballistic/shotgun/doublebarrel/holy
ammo_type = /obj/item/ammo_casing/a12g/silver
desc = "Alright you primitive screw heads, listen up. See this? This... is my BOOMSTICK."
- holy = TRUE
/obj/item/gun/ballistic/shotgun/doublebarrel/flare
name = "signal shotgun"
@@ -227,7 +226,6 @@
/obj/item/gun/ballistic/shotgun/doublebarrel/sawn/alt/holy // A Special Skin for the sawn off,makes it look like the sawn off from Blood.
ammo_type = /obj/item/ammo_casing/a12g/silver
- holy = TRUE
/obj/item/gun/ballistic/shotgun/doublebarrel/quad
name = "quad-barreled shotgun"
@@ -302,7 +300,6 @@
desc = "A Brass Flare Gun far more exspensuve and well made then the plastic ones mass produced for signalling. It fires using an odd clockwork mechanism. Loads using 12g"
icon_state = "flareg-holy"
accuracy = 50 //Strong Gun Better Accuracy
- holy = TRUE
/obj/item/gun/ballistic/shotgun/doublebarrel/axe
name = "Shot Axe"
@@ -318,7 +315,6 @@
slot_flags = SLOT_BACK
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2, TECH_OCCULT = 1)
damage_mode = DAMAGE_MODE_SHARP | DAMAGE_MODE_EDGE
- holy = TRUE
/obj/item/gun/ballistic/shotgun/underslung
name = "underslung shotgun"
diff --git a/code/modules/projectiles/guns/energy/netgun_vr.dm b/code/modules/projectiles/guns/energy/netgun_vr.dm
index eb47eb0b01ee..78697ca888ea 100644
--- a/code/modules/projectiles/guns/energy/netgun_vr.dm
+++ b/code/modules/projectiles/guns/energy/netgun_vr.dm
@@ -31,6 +31,6 @@
overlays_to_add += "[initial(icon_state)]_cell"
overlays_to_add += "[initial(icon_state)]_[ratio]"
- overlays_to_add += "[initial(icon_state)]_[mode_name]"
+ overlays_to_add += "[initial(icon_state)]_[legacy_get_firemode()?.name]"
add_overlay(overlays_to_add)
diff --git a/code/modules/projectiles/guns/energy/particle.dm b/code/modules/projectiles/guns/energy/particle.dm
index 0c541ecdb30f..f5288b0b5703 100644
--- a/code/modules/projectiles/guns/energy/particle.dm
+++ b/code/modules/projectiles/guns/energy/particle.dm
@@ -18,7 +18,9 @@
w_class = WEIGHT_CLASS_NORMAL
projectile_type = /obj/projectile/bullet/particle
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2, TECH_MATERIAL = 2)
- fire_delay = 10
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 1 SECONDS;
+ }
charge_cost = 200 //slightly more shots than lasers
var/safetycatch = 0 //if 1, won't let you fire in pressurised environment, rather than malfunctioning
var/obj/item/pressurelock/attached_safety
@@ -34,7 +36,9 @@
w_class = WEIGHT_CLASS_BULKY //bigger than a pistol, too.
heavy = TRUE
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 5, TECH_POWER = 3, TECH_MAGNET = 3)
- fire_delay = 6 //This one's not a handgun, it should have the same fire delay as everything else
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 0.6 SECONDS;
+ }
self_recharge = 1
modifystate = null
legacy_battery_lock = 1
@@ -52,7 +56,9 @@
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 5, TECH_POWER = 4, TECH_MAGNET = 4)
projectile_type = /obj/projectile/bullet/particle/heavy
legacy_battery_lock = 1
- fire_delay = 15 // fires faster than a laser cannon. c'mon, it's an awesome-but-impractical endgame gun.
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 1.5 SECONDS;
+ }
w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack.
damage_force = 10
one_handed_penalty = 60 // The thing's heavy and huge.
@@ -115,7 +121,8 @@
obj_cell_slot.cell.maxcharge = 1 //just to avoid div/0 runtimes
obj_cell_slot.cell.desc += " It seems to be burnt out!"
desc += " The casing is covered in scorch-marks."
- fire_delay += fire_delay // even if you swap out the cell for a good one, the gun's cluckety-clucked.
+ // todo: transform_cycle_cooldown(datum/firing_cycle/cycle) as num
+ // fire_delay += fire_delay // even if you swap out the cell for a good one, the gun's cluckety-clucked.
charge_cost += charge_cost
update_icon()
else if (severity <= 150) // 10% chance of exploding
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index f9ee055ab29b..80521a40f866 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -185,6 +185,24 @@
projectile_type = "/obj/projectile/forcebolt"
*/
+/datum/firemode/energy/dakkalaser
+ burst_delay = 0.1 SECONDS
+
+/datum/firemode/energy/dakkalaser/single
+ name = "1-shot"
+ burst_amount = 1
+ legacy_direct_varedits = list(dispersion = list(0), charge_cost = 24)
+
+/datum/firemode/energy/dakkalaser/five
+ name = "5-burst"
+ burst_amount = 5
+ legacy_direct_varedits = list(burst_accuracy = list(75,75,75,75,75), dispersion = list(1,1,1,1,1))
+
+/datum/firemode/energy/dakkalaser/ten
+ name = "10-burst"
+ burst_amount = 10
+ legacy_direct_varedits = list(burst_accuracy = list(75,75,75,75,75,75,75,75,75,75), dispersion = list(2,2,2,2,2,2,2,2,2,2))
+
/obj/item/gun/energy/dakkalaser
name = "suppression gun"
desc = "Coined 'Sparkers' by Tyrmalin dissidents on Larona upon it's inception, the HI-LLG is an energy-based suppression system, used to overwhelm the opposition in a hail of laser blasts."
@@ -203,10 +221,10 @@
one_handed_penalty = 60
firemodes = list(
- list(mode_name="single shot", burst = 1, burst_accuracy = list(75), dispersion = list(0), charge_cost = 24),
- list(mode_name="five shot burst", burst = 5, burst_accuracy = list(75,75,75,75,75), dispersion = list(1,1,1,1,1)),
- list(mode_name="ten shot burst", burst = 10, burst_accuracy = list(75,75,75,75,75,75,75,75,75,75), dispersion = list(2,2,2,2,2,2,2,2,2,2)),
- )
+ /datum/firemode/energy/dakkalaser/one,
+ /datum/firemode/energy/dakkalaser/five,
+ /datum/firemode/energy/dakkalaser/ten,
+ )
/obj/item/gun/energy/maghowitzer
name = "portable MHD howitzer"
@@ -309,7 +327,9 @@
icon = 'icons/obj/gun/energy.dmi'
slot_flags = SLOT_BELT
accuracy = 100
- fire_delay = 12
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 1.2 SECONDS;
+ }
fire_sound = 'sound/weapons/eluger.ogg'
projectile_type = /obj/projectile/beam/medigun
@@ -318,6 +338,7 @@
cell_type = /obj/item/cell/high
charge_cost = 2500
+#warn rework this and have a radial preview mode for firemodes
/obj/item/gun/energy/service
name = "service weapon"
icon_state = "service_grip"
@@ -335,45 +356,6 @@
one_handed_penalty = 0
safety_state = GUN_SAFETY_OFF
-/obj/item/gun/energy/service/attack_self(mob/user, datum/event_args/actor/actor)
- . = ..()
- if(.)
- return
- cycle_weapon(user)
-
-/obj/item/gun/energy/service/proc/cycle_weapon(mob/living/L)
- var/obj/item/service_weapon
- var/list/service_weapon_list = subtypesof(/obj/item/gun/energy/service)
- var/list/display_names = list()
- var/list/service_icons = list()
- for(var/V in service_weapon_list)
- var/obj/item/gun/energy/service/weapontype = V
- if (V)
- display_names[initial(weapontype.name)] = weapontype
- service_icons += list(initial(weapontype.name) = image(icon = initial(weapontype.icon), icon_state = initial(weapontype.icon_state)))
-
- service_icons = sortList(service_icons)
-
- var/choice = show_radial_menu(L, src, service_icons)
- if(!choice || !check_menu(L))
- return
-
- var/A = display_names[choice] // This needs to be on a separate var as list member access is not allowed for new
- service_weapon = new A
-
- if(service_weapon)
- qdel(src)
- L.put_in_active_hand(service_weapon)
-
-/obj/item/gun/energy/service/proc/check_menu(mob/user)
- if(!istype(user))
- return FALSE
- if(QDELETED(src))
- return FALSE
- if(user.incapacitated())
- return FALSE
- return TRUE
-
/obj/item/gun/energy/service/grip
/obj/item/gun/energy/service/shatter
@@ -426,7 +408,9 @@
icon_state = "ermitter_gun"
item_state = "pulse"
projectile_type = /obj/projectile/beam/emitter
- fire_delay = 2 SECONDS
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 2 SECONDS;
+ }
charge_cost = 900
cell_type = /obj/item/cell
cell_system_legacy_use_device = FALSE
@@ -461,6 +445,18 @@
damage_force = 10
one_handed_penalty = 60
+// todo: nuke plasma weapons from orbit and rework
+/datum/firemode/energy/plasma
+ cycle_cooldown = 2 SECONDS
+
+/datum/firemode/energy/plasma/normal
+ name = "standard"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/plasma, charge_cost = 350)
+
+/datum/firemode/energy/plasma/high
+ name = "high power"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/plasma/hot, charge_cost = 370)
+
//Plasma Guns Plasma Guns!
/obj/item/gun/energy/plasma
name = "\improper Balrog plasma rifle"
@@ -468,7 +464,6 @@
icon_state = "prifle"
item_state = null
projectile_type = /obj/projectile/plasma
- fire_delay = 20
charge_cost = 400
cell_type = /obj/item/cell/device/weapon
slot_flags = SLOT_BELT|SLOT_BACK
@@ -481,17 +476,13 @@
var/overheating = 0
firemodes = list(
- list(mode_name="standard", projectile_type=/obj/projectile/plasma, charge_cost = 350),
- list(mode_name="high power", projectile_type=/obj/projectile/plasma/hot, charge_cost = 370),
- )
+ /datum/firemode/energy/plasma/normal,
+ /datum/firemode/energy/plasma/high,
+ )
-/obj/item/gun/energy/plasma/update_icon()
- . = ..()
- if(overheating)
- icon_state = "prifle_overheat"
- update_held_icon()
- else
- return
+/obj/item/gun/energy/plasma/update_icon_state()
+ icon_state = "[initial(icon_state)][overheating ? "_overheat" : ""]"
+ return ..()
/obj/item/gun/energy/plasma/pistol
name = "\improper Wyrm plasma pistol"
@@ -504,11 +495,3 @@
origin_tech = list(TECH_COMBAT = 6, TECH_ENGINEERING = 5, TECH_MAGNET = 5)
materials_base = list(MAT_STEEL = 8000, MAT_GLASS = 2000)
one_handed_penalty = 10
-
-/obj/item/gun/energy/plasma/pistol/update_icon()
- . = ..()
- if(overheating)
- icon_state = "ppistol_overheat"
- update_held_icon()
- else
- return
diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm
index f35c1e3cc4c1..f9434bcb44c1 100644
--- a/code/modules/projectiles/guns/energy/stun.dm
+++ b/code/modules/projectiles/guns/energy/stun.dm
@@ -1,20 +1,27 @@
+/datum/firemode/energy/taser
+ cycle_cooldown = 0.4 SECONDS
+
+/datum/firemode/energy/taser/stun
+ name = "stun"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/energy/electrode, modifystate="taser", charge_cost = 240)
+
+/datum/firemode/energy/taser/disable
+ name = "disable"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/disabler/weak, modifystate="taserblue", charge_cost = 160)
+
/obj/item/gun/energy/taser
name = "taser gun"
desc = "The NT Mk31 NL is a small gun used for non-lethal takedowns. An NT exclusive iteration of the Mk30 WT design, the Mk31 features a variable output mechanism which draws from a singular power source, allowing for versatile firing solutions without increased weight."
icon_state = "taser"
item_state = null //so the human update icon uses the icon_state instead.
- fire_delay = 4
-
worth_intrinsic = 350
-
- projectile_type = /obj/projectile/energy/electrode
modifystate = "taser"
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/energy/electrode, modifystate="taser", charge_cost = 240),
- list(mode_name="disable", projectile_type=/obj/projectile/beam/disabler/weak, modifystate="taserblue", charge_cost = 160),
- )
+ /datum/firemode/energy/taser/stun,
+ /datum/firemode/energy/taser/disable,
+ )
/obj/item/gun/energy/taser/mounted
name = "mounted taser gun"
diff --git a/code/modules/projectiles/guns/firemode.dm b/code/modules/projectiles/guns/firemode.dm
new file mode 100644
index 000000000000..5608be64d66a
--- /dev/null
+++ b/code/modules/projectiles/guns/firemode.dm
@@ -0,0 +1,48 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/datum/firemode
+ /// The name of the firemode. This is what is shown in VV, **and** to players.
+ var/name = "normal"
+
+ //* firing *//
+ /// number of shots in burst
+ var/burst_amount = 1
+ /// delay between burst shots
+ var/burst_delay = 0.2 SECONDS
+ /// delay **after** the firing cycle which we cannot fire
+ var/cycle_cooldown = 0.4 SECONDS
+
+ //* rendering *//
+ /// state key for rendering, if any
+ var/render_key
+
+ //* LEGACY *//
+ /// direct vv edits to the gun applied when we're selected.
+ ///
+ /// * this is shit, but it is what it is, for now. we're migrating things out of
+ /// it, slowly.
+ var/list/legacy_direct_varedits
+
+// todo: this shouldn't even exist.
+/datum/firemode/New(obj/item/gun/inherit_from_gun, list/direct_varedits)
+ if(!length(direct_varedits))
+ return
+ for(var/varname in direct_varedits)
+ var/value = direct_varedits[varname]
+ // pull out special crap
+ switch(varname)
+ if("mode_name")
+ src.name = value
+ if("burst")
+ src.burst_amount = value
+ if("fire_delay")
+ src.cycle_cooldown = value
+ if("burst_delay")
+ src.burst_delay = value
+ LAZYSET(legacy_direct_varedits, varname, value || inherit_from_gun.vars[varname])
+
+// todo: annihilate this
+/datum/firemode/proc/apply_legacy_variables(obj/item/gun/gun)
+ for(var/varname in legacy_direct_varedits)
+ gun.vars[propname] = legacy_direct_varedits[propname]
diff --git a/code/modules/projectiles/guns/gun-modular.dm b/code/modules/projectiles/guns/gun-modular.dm
index 65ef223a8d9c..94dea19fed93 100644
--- a/code/modules/projectiles/guns/gun-modular.dm
+++ b/code/modules/projectiles/guns/gun-modular.dm
@@ -6,15 +6,16 @@
/**
* hard check
*/
-/obj/item/gun/proc/can_install_component(obj/item/gun_component/component, force)
+/obj/item/gun/proc/can_install_component(obj/item/gun_component/component, datum/event_args/actor/actor, silent, force)
SHOULD_NOT_OVERRIDE(TRUE)
+ var/is_full = FALSE
#warn slot enforcement
- return force || component.fits_on_gun(src, fits_modular_component(component))
+ return force || component.fits_on_gun(src, fits_modular_component(component), is_full, datum/event_args/actor/actor, silent)
/**
* checks if we can attach a component; component gets final say
*/
-/obj/item/gun/proc/fits_modular_component(obj/item/gun_component/component)
+/obj/item/gun/proc/fits_modular_component(obj/item/gun_component/component, datum/event_args/actor/actor, silent)
return TRUE
//* Modular Components - Add / Remove *//
@@ -22,26 +23,26 @@
/**
* * moves the component into us if it wasn't already
*/
-/obj/item/gun/proc/attach_modular_component(obj/item/gun_component/component, force)
+/obj/item/gun/proc/attach_modular_component(obj/item/gun_component/component, datum/event_args/actor/actor, silent, force)
#warn impl
/**
* * deletes the component if no location is provided to move it to
*/
-/obj/item/gun/proc/detach_modular_component(obj/item/gun_component/component, atom/new_loc)
+/obj/item/gun/proc/detach_modular_component(obj/item/gun_component/component, datum/event_args/actor/actor, silent, atom/new_loc)
#warn impl
#warn hook everything in attackby's
//* Modular Components - API *//
-
+
/**
* Try to use a certain amount of power.
*
* @return amount used
*/
/obj/item/gun/proc/modular_use_power(obj/item/gun_component/component, joules)
- return 0
+ return obj_cell_slot?.use(DYNAMIC_J_TO_CELL_UNITS(joules))
/**
* Try to use a certain amount of power. Fails if insufficient.
@@ -54,4 +55,4 @@
* @return amount used
*/
/obj/item/gun/proc/modular_use_checked_power(obj/item/gun_component/component, joules, reserve)
- return 0
+ return obj_cell_slot?.checked_use(DYNAMIC_J_TO_CELL_UNITS(joules), reserve)
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 781916d5e8b5..96ea6f78d5a4 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -1,46 +1,3 @@
-/*
- Defines a firing mode for a gun.
-
- A firemode is created from a list of fire mode settings. Each setting modifies the value of the gun var with the same name.
- If the fire mode value for a setting is null, it will be replaced with the initial value of that gun's variable when the firemode is created.
- Obviously not compatible with variables that take a null value. If a setting is not present, then the corresponding var will not be modified.
-*/
-/datum/firemode
- var/name = "default"
- var/list/settings = list()
-
- //* firing *//
- /// number of shots in burst
- var/burst_amount = 1
- /// delay between burst shots
- var/burst_delay = 0.2 SECONDS
-
- /// delay **after** the firing cycle which we cannot fire
- var/cooldown = 0.4 SECONDS
-
- //* rendering *//
- /// state key for rendering, if any
- var/render_key
-
-/datum/firemode/New(obj/item/gun/gun, list/properties = null)
- ..()
- if(!properties) return
-
- for(var/propname in properties)
- var/propvalue = properties[propname]
-
- if(propname == "mode_name")
- name = propvalue
- if(isnull(propvalue))
- settings[propname] = gun.vars[propname] //better than initial() as it handles list vars like burst_accuracy
- else
- settings[propname] = propvalue
-
- #warn automatically pull `burst`, `fire_delay`, `burst_delay` from list and set
-
-/datum/firemode/proc/apply_to(obj/item/gun/gun)
- for(var/propname in settings)
- gun.vars[propname] = settings[propname]
/**
* Guns
@@ -81,6 +38,21 @@
/// * this is a default value; set to null by default to have the projectile's say.
var/accuracy_disabled = null
+ //* Firemode *//
+ /**
+ * The list of our possible firemodes.
+ *
+ * Firemodes may be;
+ *
+ * * an instance: this will be kept around per gun
+ * * an anonymous type (byond 'pop' object with /typepath{varedit = "abc";} syntax):
+ * this will be kept around per gun
+ * * a typepath: this will be globally cached
+ *
+ * This variable may either be a list, of the above, or a singular of the above.
+ */
+ var/list/firemodes = /datum/firemode
+
//* Firing *//
/// the current firing cycle
@@ -94,11 +66,9 @@
/// last world.time we fired a shot
var/last_fire = 0
/// next world.time we can start a firing cycle
- var/next_fire = 0
+ var/next_fire_cycle = 0
// legacy below //
-
- var/move_delay = 1
var/fire_sound = null // This is handled by projectile.dm's fire_sound var now, but you can override the projectile's fire_sound with this one if you want to.
var/fire_sound_text = "gunshot"
var/fire_anim = null
@@ -111,10 +81,8 @@
var/scoped_accuracy = null
var/list/burst_accuracy = list(0) //allows for different accuracies for each shot in a burst. Applied on top of accuracy
var/list/dispersion = list(0)
- var/mode_name = null
// todo: purge with fire
var/projectile_type = /obj/projectile //On ballistics, only used to check for the cham gun
- var/holy = FALSE //For Divinely blessed guns
// todo: this should be on /ballistic, and be `internal_chambered`.
var/obj/item/ammo_casing/chambered = null
@@ -123,7 +91,6 @@
var/atom/movable/screen/auto_target/auto_target
var/sel_mode = 1 //index of the currently selected mode
- var/list/firemodes = list()
var/selector_sound = 'sound/weapons/guns/selector.ogg'
//aiming system stuff
@@ -131,8 +98,6 @@
//0 for one bullet after tarrget moves and aim is lowered
var/multi_aim = 0 //Used to determine if you can target multiple people.
var/tmp/list/mob/living/aim_targets //List of who yer targeting.
- var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
- var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/tmp/lock_time = -100
/// whether or not we have safeties and if safeties are on
@@ -142,12 +107,6 @@
var/shaded_charge = FALSE
var/ammo_x_offset = 2
var/ammo_y_offset = 0
- var/can_flashlight = FALSE
- var/gun_light = FALSE
- var/light_state = "flight"
- var/light_brightness = 4
- var/flight_x_offset = 0
- var/flight_y_offset = 0
var/obj/item/firing_pin/pin = /obj/item/firing_pin
var/no_pin_required = 0
@@ -156,6 +115,7 @@
//Gun Malfunction variables
var/unstable = 0
var/destroyed = 0
+ var/automatic = 0 //can gun use it, 0 is no, anything above 0 is the delay between clicks in ds
//* THIS IS A WIP SYSTEM!! *//
// todo: well, finish this.
@@ -269,6 +229,8 @@
SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_guns.dmi',
)
+ if(!islist(firemodes))
+ firemodes = list(firemodes)
for(var/i in 1 to firemodes.len)
var/key = firemodes[i]
if(islist(key))
@@ -329,6 +291,9 @@
else
return ..()
+/obj/item/gun/CanItemAutoclick(object, location, params)
+ . = automatic
+
/obj/item/gun/proc/toggle_flashlight()
if(gun_light)
set_light(0)
@@ -704,7 +669,7 @@
if(sel_mode > firemodes.len)
sel_mode = 1
var/datum/firemode/new_mode = firemodes[sel_mode]
- new_mode.apply_to(src)
+ new_mode.apply_legacy_variables(src)
if(user)
to_chat(user, "\The [src] is now set to [new_mode.name].")
playsound(loc, selector_sound, 50, 1)
@@ -780,7 +745,7 @@
return (safety_state == GUN_SAFETY_ON)
// PENDING FIREMODE REWORK
-/obj/item/gun/proc/legacy_get_firemode()
+/obj/item/gun/proc/legacy_get_firemode() as /datum/firemode
if(!length(firemodes) || (sel_mode > length(firemodes)))
return
return firemodes[sel_mode]
diff --git a/code/modules/projectiles/guns/gun_component.dm b/code/modules/projectiles/guns/gun_component.dm
index 6a9fa61773bb..f16fdc734e08 100644
--- a/code/modules/projectiles/guns/gun_component.dm
+++ b/code/modules/projectiles/guns/gun_component.dm
@@ -20,6 +20,9 @@
/// should we be hidden from examine?
var/show_on_examine = TRUE
+ /// currently attached gun
+ var/obj/item/gun/attached
+
//* Attach / Detach *//
/**
@@ -32,20 +35,22 @@
* * gun - the gun we tried to attach to
* * gun_opinion - what the gun had to say about it
* * gun_is_full - is the gun out of slots for us? we can still override but this is to separate it from gun_opinion.
+ * * actor - person initiating it; this is mostly for message feedback
+ * * silent - do not emit message to user on fail
*/
-/obj/item/gun_component/proc/fits_on_gun(obj/item/gun/gun, gun_opinion, gun_is_full)
+/obj/item/gun_component/proc/fits_on_gun(obj/item/gun/gun, gun_opinion, gun_is_full, datum/event_args/actor/actor, silent)
return TRUE
/**
* called on attach
*/
-/obj/item/gun_component/proc/on_attach(obj/item/gun/gun)
+/obj/item/gun_component/proc/on_attach(obj/item/gun/gun, datum/event_args/actor/actor, silent)
SHOULD_CALL_PARENT(TRUE)
/**
* called on detach
*/
-/obj/item/gun_component/proc/on_detach(obj/item/gun/gun)
+/obj/item/gun_component/proc/on_detach(obj/item/gun/gun, datum/event_args/actor/actor, silent)
SHOULD_CALL_PARENT(TRUE)
//* Information *//
@@ -57,3 +62,4 @@
*/
/obj/item/gun_component/proc/summarize_bullet_points(datum/event_args/actor/actor)
return list()
+
diff --git a/code/modules/projectiles/guns/gun_component/acceleration_coil.dm b/code/modules/projectiles/guns/gun_component/acceleration_coil.dm
index f90e1039463d..800418edc0c4 100644
--- a/code/modules/projectiles/guns/gun_component/acceleration_coil.dm
+++ b/code/modules/projectiles/guns/gun_component/acceleration_coil.dm
@@ -14,3 +14,5 @@
"}
#warn impl all
+
+// TODO: This file is mostly stubs and WIPs.
diff --git a/code/modules/projectiles/guns/gun_component/active_cooler.dm b/code/modules/projectiles/guns/gun_component/active_cooler.dm
index e228c80dee8f..94af9b9cf937 100644
--- a/code/modules/projectiles/guns/gun_component/active_cooler.dm
+++ b/code/modules/projectiles/guns/gun_component/active_cooler.dm
@@ -26,3 +26,5 @@
"}
#warn impl all
+
+// TODO: This file is mostly stubs and WIPs.
diff --git a/code/modules/projectiles/guns/gun_component/energy_handler.dm b/code/modules/projectiles/guns/gun_component/energy_handler.dm
index 12a81f717475..3f07ff52a76d 100644
--- a/code/modules/projectiles/guns/gun_component/energy_handler.dm
+++ b/code/modules/projectiles/guns/gun_component/energy_handler.dm
@@ -43,3 +43,5 @@
. += "Suffers decreased efficiency on burst shots."
#warn impl all
+
+// TODO: This file is mostly stubs and WIPs.
diff --git a/code/modules/projectiles/guns/gun_component/internal_module.dm b/code/modules/projectiles/guns/gun_component/internal_module.dm
index d0995e2ce41d..4f6aaed4eb70 100644
--- a/code/modules/projectiles/guns/gun_component/internal_module.dm
+++ b/code/modules/projectiles/guns/gun_component/internal_module.dm
@@ -6,3 +6,5 @@
component_slot = GUN_COMPONENT_INTERNAL_MODULE
#warn impl all
+
+// TODO: This file is mostly stubs and WIPs.
diff --git a/code/modules/projectiles/guns/gun_component/power_unit.dm b/code/modules/projectiles/guns/gun_component/power_unit.dm
index 51e7d8077568..39f2c560301d 100644
--- a/code/modules/projectiles/guns/gun_component/power_unit.dm
+++ b/code/modules/projectiles/guns/gun_component/power_unit.dm
@@ -6,3 +6,5 @@
component_slot = GUN_COMPONENT_POWER_UNIT
#warn impl all
+
+// TODO: This file is mostly stubs and WIPs.
diff --git a/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm b/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
index 8bb79fbeff2e..497a1fefac2f 100644
--- a/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
+++ b/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
@@ -109,6 +109,17 @@
icon_state = (ammo_magazine)? "stg60" : "stg60-e"
item_state = (ammo_magazine)? "arifle" : "arifle-e"
+/datum/firemode/energy/eluger
+ cycle_cooldown = 0.4 SECONDS
+
+/datum/firemode/energy/eluger/stun
+ name = "stun"
+ legacy_direct_varedits = list(charge_cost=120,projectile_type=/obj/projectile/beam/stun, modifystate="elugerstun", fire_sound='sound/weapons/Taser.ogg')
+
+/datum/firemode/energy/eluger/lethal
+ name = "lethal"
+ legacy_direct_varedits = list(charge_cost=240,projectile_type=/obj/projectile/beam/eluger, modifystate="elugerkill", fire_sound='sound/weapons/eluger.ogg')
+
// ------------ Energy Luger ------------
/obj/item/gun/energy/gun/eluger
name = "energy Luger"
@@ -121,8 +132,8 @@
modifystate = "elugerstun"
fire_sound = 'sound/weapons/Taser.ogg'
firemodes = list(
- list(mode_name="stun", charge_cost=120,projectile_type=/obj/projectile/beam/stun, modifystate="elugerstun", fire_sound='sound/weapons/Taser.ogg'),
- list(mode_name="lethal", charge_cost=240,projectile_type=/obj/projectile/beam/eluger, modifystate="elugerkill", fire_sound='sound/weapons/eluger.ogg'),
+ /datum/firemode/energy/eluger/stun,
+ /datum/firemode/energy/eluger/lethal,
)
//Civilian gun
@@ -180,6 +191,18 @@
else
. += "inspector_on"
+/datum/firemode/sol_smg
+ burst_delay = 0.2 SECONDS
+
+/datum/firemode/sol_smg/one
+ name = "semi-automatic"
+ burst_amount = 1
+ legacy_direct_varedits = list()
+
+/datum/firemode/sol_smg/three
+ name = "3-round bursts"
+ burst_amount = 3
+
// No idea what this is for.
/obj/item/gun/ballistic/automatic/sol
name = "\improper \"Sol\" SMG"
@@ -193,12 +216,13 @@
allowed_magazines = list(/obj/item/ammo_magazine/a9mm)
load_method = MAGAZINE
multi_aim = 1
- burst_delay = 2
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2)
firemodes = list(
- list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, burst_accuracy=null, dispersion=null),
- list(mode_name="3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-15,-15), dispersion=list(0.0, 0.6, 1.0)),
- )
+ /datum/firemode/sol_smg/one,
+ /datum/firemode/sol_smg/three,
+ )
+ burst_accuracy=list(0,-15,-15)
+ dispersion=list(0.0, 0.6, 1.0)
/obj/item/gun/ballistic/automatic/sol/proc/update_charge()
if(!ammo_magazine)
diff --git a/code/modules/projectiles/guns/legacy_vr_guns/dominator.dm b/code/modules/projectiles/guns/legacy_vr_guns/dominator.dm
index 84173c51c78e..f86f32861976 100644
--- a/code/modules/projectiles/guns/legacy_vr_guns/dominator.dm
+++ b/code/modules/projectiles/guns/legacy_vr_guns/dominator.dm
@@ -25,7 +25,7 @@
/obj/item/gun/energy/gun/fluff/dominator/special_check(mob/user)
- if(!emagged && mode_name == "lethal" && get_security_level() == "green")
+ if(!emagged && legacy_get_firemode()?.name == "lethal" && get_security_level() == "green")
to_chat(user,"The trigger refuses to depress while on the lethal setting under security level green!")
return FALSE
diff --git a/code/modules/projectiles/guns/legacy_vr_guns/protector.dm b/code/modules/projectiles/guns/legacy_vr_guns/protector.dm
index f757e0f43492..2eaaa49f30d2 100644
--- a/code/modules/projectiles/guns/legacy_vr_guns/protector.dm
+++ b/code/modules/projectiles/guns/legacy_vr_guns/protector.dm
@@ -24,20 +24,18 @@
charge_sections = 3 //For the icon
ammo_x_offset = 2
ammo_y_offset = 0
- can_flashlight = TRUE
- light_state = "prot_light"
- flight_x_offset = 0
- flight_y_offset = 0
+
+ // todo: add flashlight attachment support
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/protector, modifystate="stun", fire_sound='sound/weapons/Taser.ogg'),
+ list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/protector, modifystate="stun", fire_sound='sound/weapons/Taser.ogg'),
list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="kill", fire_sound='sound/weapons/gauss_shoot.ogg'),
)
var/emagged = FALSE
/obj/item/gun/energy/protector/special_check(mob/user)
- if(!emagged && mode_name == "lethal" && get_security_level() == "green")
+ if(!emagged && legacy_get_firemode()?.name == "lethal" && get_security_level() == "green")
to_chat(user,"The trigger refuses to depress while on the lethal setting under security level green!")
return FALSE
@@ -86,12 +84,6 @@
else
overlays_to_add += "[icon_state]_[modifystate][ratio]"
- if(can_flashlight & gun_light)
- var/mutable_appearance/flashlight_overlay = mutable_appearance(icon, light_state)
- flashlight_overlay.pixel_x = flight_x_offset
- flashlight_overlay.pixel_y = flight_y_offset
- overlays_to_add += flashlight_overlay
-
/* Don't have one for this gun
if(itemState)
itemState += "[ratio]"
diff --git a/code/modules/projectiles/guns/legacy_vr_guns/secutor.dm b/code/modules/projectiles/guns/legacy_vr_guns/secutor.dm
index c986ae23379b..31e490494bee 100644
--- a/code/modules/projectiles/guns/legacy_vr_guns/secutor.dm
+++ b/code/modules/projectiles/guns/legacy_vr_guns/secutor.dm
@@ -1,3 +1,18 @@
+/datum/firemode/energy/secutor
+ cycle_cooldown = 0.8 SECONDS
+
+/datum/firemode/energy/secutor/stun
+ name = "stun"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/energy/electrode/secutor, modifystate="secutorstun", charge_cost = 240)
+
+/datum/firemode/energy/secutor/phase
+ name = "phase"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/energy/phase/secutor, modifystate="secutorphaser", charge_cost = 200)
+
+/datum/firemode/energy/secutor/lethal
+ name = "lethal"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/secutor, modifystate="secutorkill", charge_cost = 300)
+
// -------------- Secutor -------------
/obj/item/gun/energy/secutor
name = "\improper Secutor sidearm"
@@ -11,15 +26,12 @@
worn_render_flags = WORN_RENDER_SLOT_NO_RENDER
projectile_type = /obj/projectile/energy/electrode/secutor
- fire_delay = 8
-
- modifystate = "secutorstun"
-
firemodes = list(
- list(mode_name="stun", fire_delay=8, projectile_type=/obj/projectile/energy/electrode/secutor, modifystate="secutorstun", charge_cost = 240),
- list(mode_name="phaser", fire_delay=8, projectile_type=/obj/projectile/energy/phase/secutor, modifystate="secutorphaser", charge_cost = 200),
- list(mode_name="low-power-lethal", fire_delay=10, projectile_type=/obj/projectile/beam/secutor, modifystate="secutorkill", charge_cost = 300),
+ /datum/firemode/energy/secutor/stun,
+ /datum/firemode/energy/secutor/phase,
+ /datum/firemode/energy/secutor/lethal,
)
+ modifystate = "secutorstun"
var/emagged = FALSE
@@ -30,7 +42,7 @@
cut_overlays()
/obj/item/gun/energy/secutor/special_check(mob/user)
- if(!emagged && mode_name == "low-power-lethal" && get_security_level() == "green")
+ if(!emagged && legacy_get_firemode()?.name == "lethal" && get_security_level() == "green")
to_chat(user,"The trigger refuses to depress while on the lethal setting and while under security level blue!")
return FALSE
diff --git a/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm b/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm
index c39864e84508..5343ad80cbea 100644
--- a/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm
+++ b/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm
@@ -14,7 +14,6 @@
loaded = /obj/item/rcd_ammo/large
weight = ITEM_WEIGHT_GUN_BULKY
encumbrance = ITEM_ENCUMBRANCE_GUN_BULKY
- fire_delay = 1
cell_type = /obj/item/cell/hyper
var/initial_capacitor_type = /obj/item/stock_parts/capacitor/adv
@@ -60,7 +59,6 @@
cell_type = /obj/item/cell/infinite
initial_capacitor_type = /obj/item/stock_parts/capacitor/super
- fire_delay = 0
weight = ITEM_WEIGHT_GUN_RIDICULOUS
encumbrance = ITEM_ENCUMBRANCE_GUN_RIDICULOUS
@@ -88,8 +86,6 @@
cell_type = /obj/item/cell/hyper
initial_capacitor_type = /obj/item/stock_parts/capacitor/adv
- fire_delay = 0
-
slot_flags = SLOT_BACK
weight = ITEM_WEIGHT_GUN_LIGHT
@@ -118,9 +114,6 @@
cell_type = /obj/item/cell/high
initial_capacitor_type = /obj/item/stock_parts/capacitor
-
- fire_delay = 8
-
slot_flags = SLOT_BACK
weight = ITEM_WEIGHT_GUN_LIGHT
diff --git a/code/modules/tension/tension.dm b/code/modules/tension/tension.dm
index 584c0e458fae..64a8da1310f3 100644
--- a/code/modules/tension/tension.dm
+++ b/code/modules/tension/tension.dm
@@ -195,7 +195,7 @@
weapon_damage = P.damage_force
if(will_point_blank && a_intent == INTENT_HARM)
weapon_damage *= 1.5
- weapon_attack_speed = G.fire_delay / (1 SECOND)
+ weapon_attack_speed = (G.legacy_get_firemode()?.cycle_cooldown || (0.4 SECONDS)) / (1 SECONDS)
qdel(P)
var/average_damage = weapon_damage / weapon_attack_speed
From e2bb34d8716cd2d26f44557e225d3ab8b035d6e0 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 21:36:59 +0000
Subject: [PATCH 46/68] update
---
.../nanotrasen/items/guns/nt_pulse.dm | 10 ++--
code/modules/admin/verbs/debug.dm | 58 -------------------
.../projectiles/guns/ballistic/automatic.dm | 33 ++++++++---
.../projectiles/guns/ballistic/pistol.dm | 1 -
.../projectiles/guns/ballistic/revolver.dm | 8 ++-
.../projectiles/guns/ballistic/shotgun.dm | 11 +---
.../projectiles/guns/energy/hooklauncher.dm | 4 +-
.../projectiles/guns/energy/nuclear.dm | 1 -
code/modules/projectiles/guns/gun-modular.dm | 2 +-
code/modules/projectiles/guns/gun.dm | 17 ------
10 files changed, 42 insertions(+), 103 deletions(-)
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
index 25a94aae0da6..19b437b8aa76 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
@@ -11,12 +11,12 @@
/datum/firemode/energy/nt_pulse/rifle/laser
name = "laser"
render_key = "kill"
- settings = list(mode_name = "lethal", projectile_type = /obj/projectile/beam, charge_cost = 80)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam, charge_cost = 80)
/datum/firemode/energy/nt_pulse/rifle/pulse
name = "pulse"
render_key = "destroy"
- settings = list(mode_name = "destroy", projectile_type = /obj/projectile/beam/pulse, charge_cost = 180)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam/pulse, charge_cost = 180)
/datum/firemode/energy/nt_pulse/carbine
abstract_type = /datum/firemode/energy/nt_pulse/carbine
@@ -24,12 +24,12 @@
/datum/firemode/energy/nt_pulse/carbine/laser
name = "laser"
render_key = "kill"
- settings = list(mode_name = "lethal", projectile_type = /obj/projectile/beam, charge_cost = 120)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam, charge_cost = 120)
/datum/firemode/energy/nt_pulse/carbine/pulse
name = "pulse"
render_key = "destroy"
- settings = list(mode_name = "destroy", projectile_type = /obj/projectile/beam/pulse, charge_cost = 240)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam/pulse, charge_cost = 240)
/obj/item/gun/energy/nt_pulse
icon = 'icons/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dmi'
@@ -52,7 +52,6 @@
// todo: firemode this
heavy = TRUE
// todo: firemode this
- fire_delay = 5 // might need to nerf this to 8 later, this is a very powerful weapon.
firemodes = list(
/datum/firemode/energy/nt_pulse/rifle/laser,
@@ -86,7 +85,6 @@
base_mob_state = "pulse"
slot_flags = SLOT_BELT
// todo: firemode this
- fire_delay = 5 // might need to nerf this to 8 later, this is a very powerful weapon.
firemodes = list(
/datum/firemode/energy/nt_pulse/carbine/laser,
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 80f006814d16..ccad0cb9974f 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -14,64 +14,6 @@
feedback_add_details("admin_verb","DG2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-// callproc moved to code/modules/admin/callproc
-
-/client/proc/simple_DPS()
- set name = "Simple DPS"
- set category = "Debug"
- set desc = "Gives a really basic idea of how much hurt something in-hand does."
-
- var/obj/item/I = null
- var/mob/living/user = null
- if(isliving(usr))
- user = usr
- I = user.get_active_held_item()
- if(!I || !istype(I))
- to_chat(user, "You need to have something in your active hand, to use this verb.")
- return
- var/weapon_attack_speed = user.get_attack_speed(I) / 10
- var/weapon_damage = I.damage_force
- var/modified_damage_percent = 1
-
- for(var/datum/modifier/M in user.modifiers)
- if(!isnull(M.outgoing_melee_damage_percent))
- weapon_damage *= M.outgoing_melee_damage_percent
- modified_damage_percent *= M.outgoing_melee_damage_percent
-
- if(istype(I, /obj/item/gun))
- var/obj/item/gun/G = I
- var/obj/projectile/P
-
- if(istype(I, /obj/item/gun/energy))
- var/obj/item/gun/energy/energy_gun = G
- P = new energy_gun.projectile_type()
-
- else if(istype(I, /obj/item/gun/ballistic))
- var/obj/item/gun/ballistic/projectile_gun = G
- var/obj/item/ammo_casing/ammo = projectile_gun.chambered
- P = ammo.get_projectile()
-
- else
- to_chat(user, "DPS calculation by this verb is not supported for \the [G]'s type. Energy or Ballistic only, sorry.")
-
- weapon_damage = P.damage_force
- weapon_attack_speed = G.fire_delay / 10
- qdel(P)
-
- var/DPS = weapon_damage / weapon_attack_speed
- to_chat(user, "Damage: [weapon_damage][modified_damage_percent != 1 ? " (Modified by [modified_damage_percent*100]%)":""]")
- to_chat(user, "Attack Speed: [weapon_attack_speed]/s")
- to_chat(user, "\The [I] does [DPS] damage per second.")
- if(DPS > 0)
- to_chat(user, "At your maximum health ([user.getMaxHealth()]), it would take approximately;")
- to_chat(user, "[(user.getMaxHealth() - config_legacy.health_threshold_softcrit) / DPS] seconds to softcrit you. ([config_legacy.health_threshold_softcrit] health)")
- to_chat(user, "[(user.getMaxHealth() - config_legacy.health_threshold_crit) / DPS] seconds to hardcrit you. ([config_legacy.health_threshold_crit] health)")
- to_chat(user, "[(user.getMaxHealth() - config_legacy.health_threshold_dead) / DPS] seconds to kill you. ([config_legacy.health_threshold_dead] health)")
-
- else
- to_chat(user, "You need to be a living mob, with hands, and for an object to be in your active hand, to use this verb.")
- return
-
/client/proc/Cell()
set category = "Debug"
set name = "Cell"
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 18ef1db14d42..182dee448a27 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -123,6 +123,23 @@
/obj/item/gun/ballistic/automatic/wt550/lethal
magazine_type = /obj/item/ammo_magazine/a9mm/top_mount
+/datum/firemode/z8_bulldog
+ burst_delay = 2
+
+/datum/firemode/z8_bulldog/one
+ name = "semiauto"
+ burst_amount = 1
+ legacy_direct_varedits = list(use_launcher=null, burst_accuracy=null, dispersion=null)
+
+/datum/firemode/z8_bulldog/two
+ name = "2-round bursts"
+ burst_amount = 2
+ legacy_direct_varedits = list(use_launcher=null, burst_accuracy=list(60,45), dispersion=list(0.0, 0.6))
+
+/datum/firemode/z8_bulldog/grenade
+ name = "fire grenades"
+ legacy_direct_varedits = list(use_launcher=1, burst_accuracy=null, dispersion=null)
+
/obj/item/gun/ballistic/automatic/z8
name = "designated marksman rifle"
desc = "The Z8 Bulldog is an older model designated marksman rifle, made by the now defunct Zendai Foundries. Makes you feel like a space marine when you hold it, even though it can only hold 10 round magazines. Uses 7.62mm rounds and has an under barrel grenade launcher."
@@ -146,12 +163,11 @@
one_handed_penalty = 60
worth_intrinsic = 650 // milrp time
- burst_delay = 4
firemodes = list(
- list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, use_launcher=null, burst_accuracy=null, dispersion=null),
- list(mode_name="2-round bursts", burst=2, fire_delay=null, move_delay=6, use_launcher=null, burst_accuracy=list(60,45), dispersion=list(0.0, 0.6)),
- list(mode_name="fire grenades", burst=null, fire_delay=null, move_delay=null, use_launcher=1, burst_accuracy=null, dispersion=null)
- )
+ /datum/firemode/z8_bulldog/one,
+ /datum/firemode/z8_bulldog/two,
+ /datum/firemode/z8_bulldog/grenade,
+ )
var/use_launcher = 0
var/obj/item/gun/launcher/grenade/underslung/launcher
@@ -543,8 +559,11 @@
load_method = SPEEDLOADER
ammo_type = /obj/item/ammo_casing/a7_62mm
max_shells = 15
- burst = 3
- fire_delay = 7.2
+ firemodes = /datum/firemode{
+ burst_amount = 3,
+ burst_delay = 0.25 SECONDS,
+ cycle_cooldown = 0.72 SECONDS,
+ }
burst_accuracy = list(60,30,15)
dispersion = list(0.0, 0.6,1.0)
diff --git a/code/modules/projectiles/guns/ballistic/pistol.dm b/code/modules/projectiles/guns/ballistic/pistol.dm
index 3e6418dec61f..e639e1b860e5 100644
--- a/code/modules/projectiles/guns/ballistic/pistol.dm
+++ b/code/modules/projectiles/guns/ballistic/pistol.dm
@@ -108,7 +108,6 @@
w_class = WEIGHT_CLASS_NORMAL
caliber = /datum/ammo_caliber/a45
silenced = 1
- fire_delay = 1
recoil = 0
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_ILLEGAL = 8)
load_method = MAGAZINE
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index e5c3713aa852..4a2080f596f9 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -304,7 +304,9 @@
name = "autorevolver"
icon_state = "mosley"
desc = "A shiny Mosley Autococker automatic revolver, with black accents. Marketed as the 'Revolver for the Modern Era'. Uses .44 magnum rounds."
- fire_delay = 5.7 //Autorevolver. Also synced with the animation
+ firemodes = /datum/firemode{
+ cycle_cooldown = 0.5 SECONDS,
+ }
fire_anim = "mosley_fire"
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2)
@@ -330,7 +332,9 @@
desc = "The NT-R-7 'Ogre' combat revolver is tooled for Nanotrasen special operations. Chambered in .44 Magnum with an advanced high-speed firing mechanism, it serves as the perfect sidearm for any off the books endeavor."
icon_state = "combatrevolver"
caliber = /datum/ammo_caliber/a44
- fire_delay = 5.7
+ firemodes = /datum/firemode{
+ cycle_cooldown = 0.5 SECONDS,
+ }
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 3)
ammo_type = /obj/item/ammo_casing/a44
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index bf60aab14051..88c5049a96a4 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -160,8 +160,6 @@
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 1)
ammo_type = /obj/item/ammo_casing/a12g/beanbag
-
- burst_delay = 0
firemodes = list(
list(mode_name="fire one barrel at a time", one_handed_penalty = 15, burst=1),
list(mode_name="fire both barrels at once", one_handed_penalty = 35, burst=2),
@@ -187,12 +185,9 @@
if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/transforming/energy) || istype(A, /obj/item/pickaxe/plasmacutter))
to_chat(user, "You begin to shorten the barrel of \the [src].")
if(loaded.len)
- var/burstsetting = burst
- burst = 2
// todo: what happens if it's inside a container?
user.visible_message("The shotgun goes off!", "The shotgun goes off in your face!")
- start_firing_cycle_async(src, rand(0, 360))
- burst = burstsetting
+ start_firing_cycle_async(src, rand(0, 360), firemode = firemodes[2])
return
if(do_after(user, 30)) //SHIT IS STEALTHY EYYYYY
icon_state = "sawnshotgun"
@@ -245,11 +240,9 @@
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 1)
ammo_type = /obj/item/ammo_casing/a12g/pellet
- burst_delay = 0
-
firemodes = list(
list(mode_name="fire one barrel at a time", burst=1),
- )
+ )
/obj/item/gun/ballistic/shotgun/doublebarrel/sawn/super
name = "super shotgun"
diff --git a/code/modules/projectiles/guns/energy/hooklauncher.dm b/code/modules/projectiles/guns/energy/hooklauncher.dm
index 3cb0f23ff337..c3d2a50a8ecf 100644
--- a/code/modules/projectiles/guns/energy/hooklauncher.dm
+++ b/code/modules/projectiles/guns/energy/hooklauncher.dm
@@ -9,7 +9,9 @@
item_state = "gravwhip"
fire_sound_text = "laser blast"
- fire_delay = 15
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 1.5 SECONDS;
+ }
charge_cost = 300
cell_type = /obj/item/cell/device/weapon
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index 2f90889fc630..085fa214e6b1 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -23,7 +23,6 @@
self_recharge = 1
use_external_power = 1
-
/obj/item/gun/energy/gun/burst
name = "burst laser"
desc = "The FM-2t is a versatile energy based weapon, capable of switching between stun or kill with a three round burst option for both settings."
diff --git a/code/modules/projectiles/guns/gun-modular.dm b/code/modules/projectiles/guns/gun-modular.dm
index 94dea19fed93..2681de280c55 100644
--- a/code/modules/projectiles/guns/gun-modular.dm
+++ b/code/modules/projectiles/guns/gun-modular.dm
@@ -10,7 +10,7 @@
SHOULD_NOT_OVERRIDE(TRUE)
var/is_full = FALSE
#warn slot enforcement
- return force || component.fits_on_gun(src, fits_modular_component(component), is_full, datum/event_args/actor/actor, silent)
+ return force || component.fits_on_gun(src, fits_modular_component(component), is_full, actor, silent)
/**
* checks if we can attach a component; component gets final say
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 96ea6f78d5a4..f1af0405e375 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -285,26 +285,9 @@
to_chat(user, SPAN_NOTICE("The safety is [check_safety() ? "on" : "off"]."))
#warn component examine
-/obj/item/gun/CtrlClick(mob/user)
- if(can_flashlight && ishuman(user) && src.loc == usr && !user.incapacitated(INCAPACITATION_ALL))
- toggle_flashlight()
- else
- return ..()
-
/obj/item/gun/CanItemAutoclick(object, location, params)
. = automatic
-/obj/item/gun/proc/toggle_flashlight()
- if(gun_light)
- set_light(0)
- gun_light = FALSE
- else
- set_light(light_brightness)
- gun_light = TRUE
-
- playsound(src, 'sound/machines/button.ogg', 25)
- update_icon()
-
/obj/item/gun/update_twohanding()
if(one_handed_penalty)
var/mob/living/M = loc
From 45d259a754bec9b350b8271fe4a909470c615db4 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 21:42:56 +0000
Subject: [PATCH 47/68] Fix
---
code/modules/projectiles/guns/ballistic/automatic.dm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 182dee448a27..caa5d45931bf 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -560,9 +560,9 @@
ammo_type = /obj/item/ammo_casing/a7_62mm
max_shells = 15
firemodes = /datum/firemode{
- burst_amount = 3,
- burst_delay = 0.25 SECONDS,
- cycle_cooldown = 0.72 SECONDS,
+ burst_amount = 3;
+ burst_delay = 0.25 SECONDS;
+ cycle_cooldown = 0.72 SECONDS;
}
burst_accuracy = list(60,30,15)
dispersion = list(0.0, 0.6,1.0)
From 384bcfdb3664b3cc66051f91870ca8b1abc28c99 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 21:53:39 +0000
Subject: [PATCH 48/68] more conversiosn
---
.../projectiles/guns/ballistic/revolver.dm | 4 +-
.../projectiles/guns/energy/netgun_vr.dm | 19 ++++-
.../projectiles/guns/energy/nuclear.dm | 73 +++++++++++++++----
code/modules/projectiles/guns/firemode.dm | 4 +-
code/modules/projectiles/guns/gun.dm | 23 ------
5 files changed, 77 insertions(+), 46 deletions(-)
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index 4a2080f596f9..217080e1c7b1 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -305,7 +305,7 @@
icon_state = "mosley"
desc = "A shiny Mosley Autococker automatic revolver, with black accents. Marketed as the 'Revolver for the Modern Era'. Uses .44 magnum rounds."
firemodes = /datum/firemode{
- cycle_cooldown = 0.5 SECONDS,
+ cycle_cooldown = 0.5 SECONDS;
}
fire_anim = "mosley_fire"
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2)
@@ -333,7 +333,7 @@
icon_state = "combatrevolver"
caliber = /datum/ammo_caliber/a44
firemodes = /datum/firemode{
- cycle_cooldown = 0.5 SECONDS,
+ cycle_cooldown = 0.5 SECONDS;
}
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 3)
ammo_type = /obj/item/ammo_casing/a44
diff --git a/code/modules/projectiles/guns/energy/netgun_vr.dm b/code/modules/projectiles/guns/energy/netgun_vr.dm
index 78697ca888ea..cba92e026c2e 100644
--- a/code/modules/projectiles/guns/energy/netgun_vr.dm
+++ b/code/modules/projectiles/guns/energy/netgun_vr.dm
@@ -1,20 +1,31 @@
+/datum/firemode/energy/netgun
+ cycle_cooldown = 0.5 SECONDS
+
+/datum/firemode/energy/netgun/stun
+ name = "stun"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/stun/blue, fire_sound='sound/weapons/Taser.ogg', charge_cost=240)
+
+/datum/firemode/energy/netgun/capture
+ name = "capture"
+ cycle_cooldown = 5 SECONDS
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/energy_net, fire_sound = 'sound/weapons/eluger.ogg', charge_cost=1200)
+
+
/obj/item/gun/energy/netgun
name = "Hephaestus \'Retiarius\'"
desc = "The Hephaestus Industries 'Retiarius' stuns targets, immobilizing them in an energized net field."
catalogue_data = list()///datum/category_item/catalogue/information/organization/hephaestus)
icon_state = "hunter"
item_state = "gun" // Placeholder
- mode_name = "stun"
fire_sound = 'sound/weapons/eluger.ogg'
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 5, TECH_MAGNET = 3)
projectile_type = /obj/projectile/beam/stun/blue
charge_cost = 240
- fire_delay = 5
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/blue, fire_sound='sound/weapons/Taser.ogg', charge_cost=240, fire_delay=5),
- list(mode_name="capture", projectile_type=/obj/projectile/beam/energy_net, fire_sound = 'sound/weapons/eluger.ogg', charge_cost=1200, fire_delay=50)
+ /datum/firemode/energy/netgun/stun,
+ /datum/firemode/energy/netgun/capture,
)
/obj/item/gun/energy/netgun/update_icon()
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index 085fa214e6b1..3e277e243eec 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -5,7 +5,6 @@
then click where you want to fire. Most energy weapons can fire through windows harmlessly. To recharge this weapon, use a weapon recharger."
icon_state = "energystun100"
item_state = null //so the human update icon uses the icon_state instead.
- fire_delay = 10 // Handguns should be inferior to two-handed weapons.
worth_intrinsic = 250
@@ -14,15 +13,37 @@
modifystate = "energystun"
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/med, modifystate="energystun", charge_cost = 240),
- list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="energykill", charge_cost = 480),
- )
+ list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/med, modifystate="energystun", charge_cost = 240, fire_delay = 1 SECONDS),
+ list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="energykill", charge_cost = 480, fire_delay = 1 SECONDS),
+ )
/obj/item/gun/energy/gun/mounted
name = "mounted energy gun"
self_recharge = 1
use_external_power = 1
+/datum/firemode/energy/burst_laser
+ burst_delay = 0.2 SECONDS
+ cycle_cooldown = 0.6 SECONDS
+
+/datum/firemode/energy/burst_laser/stun
+ name = "stun"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/stun/weak, modifystate="fm-2tstun", charge_cost = 100)
+
+/datum/firemode/energy/burst_laser/stun_burst
+ name = "stun burst"
+ burst_amount = 3
+ legacy_direct_varedits = list(burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/stun/weak, modifystate="fm-2tstun")
+
+/datum/firemode/energy/burst_laser/lethal
+ name = "lethal"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/burstlaser, modifystate="fm-2tkill", charge_cost = 200)
+
+/datum/firemode/energy/burst_laser/lethal_burst
+ name = "lethal burst"
+ burst_amount = 3
+ legacy_direct_varedits = list(burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/burstlaser, modifystate="fm-2tkill")
+
/obj/item/gun/energy/gun/burst
name = "burst laser"
desc = "The FM-2t is a versatile energy based weapon, capable of switching between stun or kill with a three round burst option for both settings."
@@ -31,22 +52,42 @@
charge_cost = 100
damage_force = 8
w_class = WEIGHT_CLASS_BULKY //Probably gonna make it a rifle sooner or later
- fire_delay = 6
heavy = TRUE
projectile_type = /obj/projectile/beam/stun/weak
origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 2, TECH_ILLEGAL = 3)
modifystate = "fm-2tstun"
-// requires_two_hands = 1
one_handed_penalty = 30
worth_intrinsic = 450
firemodes = list(
- list(mode_name="stun", burst=1, projectile_type=/obj/projectile/beam/stun/weak, modifystate="fm-2tstun", charge_cost = 100),
- list(mode_name="stun burst", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/stun/weak, modifystate="fm-2tstun"),
- list(mode_name="lethal", burst=1, projectile_type=/obj/projectile/beam/burstlaser, modifystate="fm-2tkill", charge_cost = 200),
- list(mode_name="lethal burst", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/burstlaser, modifystate="fm-2tkill"),
- )
+ /datum/firemode/energy/burst_laser/stun,
+ /datum/firemode/energy/burst_laser/stun_burst,
+ /datum/firemode/energy/burst_laser/lethal,
+ /datum/firemode/energy/burst_laser/lethal_burst,
+ )
+
+/datum/firemode/energy/mining_carbine
+ burst_delay = 0.1 SECONDS
+ cycle_cooldown = 0.3 SECONDS
+
+/datum/firemode/energy/mining_carbine/mine
+ name = "mine"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/beam/excavation, modifystate="fm-2tstun", charge_cost = 20)
+
+/datum/firemode/energy/mining_carbine/mine_burst
+ name = "mine burst"
+ burst_amount = 5
+ legacy_direct_varedits = list(burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/excavation, modifystate="fm-2tstun")
+
+/datum/firemode/energy/mining_carbine/scatetr
+ name = "scatter"
+ legacy_direct_varedits = list(projectile_type=/obj/projectile/scatter/excavation, modifystate="fm-2tkill", charge_cost = 40)
+
+/datum/firemode/energy/mining_carbine/scatter_burst
+ name = "scatter burst"
+ burst_amount = 5
+ legacy_direct_varedits = list(burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/scatter/excavation, modifystate="fm-2tkill")
/obj/item/gun/energy/gun/miningcarbine
name = "mining carbine"
@@ -62,11 +103,11 @@
modifystate = "fm-2tstun"
firemodes = list(
- list(mode_name="mine", burst=1, projectile_type=/obj/projectile/beam/excavation, modifystate="fm-2tstun", charge_cost = 20),
- list(mode_name="mine burst", burst=5, fire_delay=null, move_delay=4, burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/beam/excavation, modifystate="fm-2tstun"),
- list(mode_name="scatter", burst=1, projectile_type=/obj/projectile/scatter/excavation, modifystate="fm-2tkill", charge_cost = 40),
- list(mode_name="scatter burst", burst=5, fire_delay=null, move_delay=4, burst_accuracy=list(65,65,65), dispersion=list(0.0, 0.2, 0.5), projectile_type=/obj/projectile/scatter/excavation, modifystate="fm-2tkill"),
- )
+ /datum/firemode/energy/mining_carbine/mine,
+ /datum/firemode/energy/mining_carbine/mine_burst,
+ /datum/firemode/energy/mining_carbine/scatter,
+ /datum/firemode/energy/mining_carbine/scatter_burst,
+ )
/obj/item/gun/energy/gun/nuclear
name = "advanced energy gun"
diff --git a/code/modules/projectiles/guns/firemode.dm b/code/modules/projectiles/guns/firemode.dm
index 5608be64d66a..5555e1e396c1 100644
--- a/code/modules/projectiles/guns/firemode.dm
+++ b/code/modules/projectiles/guns/firemode.dm
@@ -22,6 +22,8 @@
///
/// * this is shit, but it is what it is, for now. we're migrating things out of
/// it, slowly.
+ /// * passed in variables from direct varedits in New() will be append-overwrite
+ /// for this list.
var/list/legacy_direct_varedits
// todo: this shouldn't even exist.
@@ -45,4 +47,4 @@
// todo: annihilate this
/datum/firemode/proc/apply_legacy_variables(obj/item/gun/gun)
for(var/varname in legacy_direct_varedits)
- gun.vars[propname] = legacy_direct_varedits[propname]
+ gun.vars[varname] = legacy_direct_varedits[varname]
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index f1af0405e375..02c8dd80405f 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -329,31 +329,8 @@
return 0
if(!handle_pins(user))
return 0
-
- var/mob/living/M = user
- if(MUTATION_HULK in M.mutations)
- to_chat(M, "Your fingers are much too large for the trigger guard!")
- return 0
- if((MUTATION_CLUMSY in M.mutations) && prob(40)) //Clumsy handling
- var/obj/P = consume_next_projectile()
- if(P)
- if(process_projectile(P, user, user, pick("l_foot", "r_foot")))
- handle_post_fire(user, user)
- var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
- user.visible_message(
- "\The [user] shoots [TU.himself] in the foot with \the [src]!",
- "You shoot yourself in the foot with \the [src]!"
- )
- M.drop_item_to_ground(src)
- else
- handle_click_empty(user)
- return 0
return 1
-/obj/item/gun/emp_act(severity)
- for(var/obj/O in contents)
- O.emp_act(severity)
-
/obj/item/gun/dropped(mob/user, flags, atom/newLoc)
. = ..()
update_appearance()
From 812d80e44bbff7205525a0b56f8a316f1760c557 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Wed, 6 Nov 2024 22:10:10 +0000
Subject: [PATCH 49/68] fixeS
---
code/modules/projectiles/guns/energy/laser.dm | 16 +++++++++-------
.../guns/energy/modular/modulargun.dm | 4 ++--
code/modules/projectiles/guns/energy/nuclear.dm | 3 +--
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 85a5566841cc..a6fd1b888c02 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -109,7 +109,6 @@
origin_tech = list(TECH_COMBAT = 8, TECH_MAGNET = 7)
modifystate = "alienpistol"
-
/obj/item/gun/energy/captain
name = "antique laser gun"
icon_state = "caplaser"
@@ -120,7 +119,6 @@
w_class = WEIGHT_CLASS_NORMAL
projectile_type = /obj/projectile/beam
origin_tech = null
- fire_delay = 10 //Old pistol
charge_cost = 480 //to compensate a bit for self-recharging
cell_type = /obj/item/cell/device/weapon/recharge/captain
legacy_battery_lock = 1
@@ -133,8 +131,10 @@
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 3, TECH_POWER = 3)
slot_flags = SLOT_BELT|SLOT_BACK
projectile_type = /obj/projectile/beam/heavylaser/cannon
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 2 SECONDS;
+ }
legacy_battery_lock = 1
- fire_delay = 20
w_class = WEIGHT_CLASS_BULKY
heavy = TRUE
one_handed_penalty = 90 // The thing's heavy and huge.
@@ -150,7 +150,6 @@
one_handed_penalty = 0 // Not sure if two-handing gets checked for mounted weapons, but better safe than sorry.
projectile_type = /obj/projectile/beam/heavylaser
charge_cost = 400
- fire_delay = 20
/obj/item/gun/energy/xray
name = "xray laser gun"
@@ -178,9 +177,11 @@
worth_intrinsic = 750
projectile_type = /obj/projectile/beam/sniper
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 3.5 SECONDS;
+ }
slot_flags = SLOT_BACK
charge_cost = 600
- fire_delay = 35
damage_force = 10
heavy = TRUE
w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack.
@@ -217,7 +218,6 @@
projectile_type = /obj/projectile/beam/sniper
slot_flags = SLOT_BACK
charge_cost = 1300
- fire_delay = 20
damage_force = 8
heavy = TRUE
w_class = WEIGHT_CLASS_BULKY
@@ -336,7 +336,9 @@
desc = "A sturdy laser rifle fine tuned for Nanotrasen special operations. More reliable than mass production models, this weapon was designed to kill, and nothing else."
icon_state = "clrifle"
item_state = "clrifle"
- fire_delay = 6
+ firemodes = /datum/firemode/energy{
+ cycle_cooldown = 0.6 SECONDS;
+ }
slot_flags = SLOT_BELT|SLOT_BACK
w_class = WEIGHT_CLASS_BULKY
damage_force = 10
diff --git a/code/modules/projectiles/guns/energy/modular/modulargun.dm b/code/modules/projectiles/guns/energy/modular/modulargun.dm
index 89e7eb2eeca7..1447e773e8c4 100644
--- a/code/modules/projectiles/guns/energy/modular/modulargun.dm
+++ b/code/modules/projectiles/guns/energy/modular/modulargun.dm
@@ -49,7 +49,7 @@
if(!length(firemodes))
return
var/datum/firemode/new_mode = firemodes[1]
- new_mode.apply_to(src)
+ new_mode.apply_legacy_variables(src)
/obj/item/gun/energy/modular/proc/do_generatefiremodes() //Accepts no args. Checks the gun's current components and generates projectile types, firemode costs and max burst. Should be called after changing parts or part values.
if(!circuit)
@@ -188,7 +188,7 @@
if(projectile_type == /obj/projectile)
to_chat(user, "The gun is experiencing a checking error! Open and close the weapon, or try removing all the parts and placing them back in.")
var/datum/firemode/new_mode = firemodes[1]
- new_mode.apply_to(src)
+ new_mode.apply_legacy_variables(src)
return FALSE
/obj/item/gun/energy/modular/attackby(obj/item/I, mob/living/user, list/params, clickchain_flags, damage_multiplier)
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index 3e277e243eec..2478736c1d0d 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -97,7 +97,6 @@
charge_cost = 20
damage_force = 8
w_class = WEIGHT_CLASS_BULKY
- fire_delay = 3
projectile_type = /obj/projectile/beam/excavation
origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 2, TECH_ILLEGAL = 2)
modifystate = "fm-2tstun"
@@ -107,7 +106,7 @@
/datum/firemode/energy/mining_carbine/mine_burst,
/datum/firemode/energy/mining_carbine/scatter,
/datum/firemode/energy/mining_carbine/scatter_burst,
- )
+ )
/obj/item/gun/energy/gun/nuclear
name = "advanced energy gun"
From 726770a0439f138a728024b42929b4d4d7fbc570 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:25:47 +0000
Subject: [PATCH 50/68] changes
---
citadel.dme | 2 ++
code/__HELPERS/type_processing.dm | 1 -
.../__HELPERS/typepaths/subtypesof_non_abstract.dm | 14 ++++++++++++++
code/__HELPERS/typepaths/typesof_non_abstract.dm | 14 ++++++++++++++
4 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 code/__HELPERS/typepaths/subtypesof_non_abstract.dm
create mode 100644 code/__HELPERS/typepaths/typesof_non_abstract.dm
diff --git a/citadel.dme b/citadel.dme
index 2a43afd3033d..374e1c62564d 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -466,6 +466,8 @@
#include "code\__HELPERS\text\scramble.dm"
#include "code\__HELPERS\type2type\color.dm"
#include "code\__HELPERS\type2type\type2type.dm"
+#include "code\__HELPERS\typepaths\subtypesof_non_abstract.dm"
+#include "code\__HELPERS\typepaths\typesof_non_abstract.dm"
#include "code\__HELPERS\unsorted\contents.dm"
#include "code\__HELPERS\unsorted\locate.dm"
#include "code\__HELPERS\unsorted\radiation.dm"
diff --git a/code/__HELPERS/type_processing.dm b/code/__HELPERS/type_processing.dm
index 5ab1778c6eb6..f49f6dcbdfba 100644
--- a/code/__HELPERS/type_processing.dm
+++ b/code/__HELPERS/type_processing.dm
@@ -51,7 +51,6 @@
/proc/get_fancy_list_of_atom_types()
return make_types_fancy(typesof(/atom))
-
/proc/get_fancy_list_of_datum_types()
return make_types_fancy(typesof(/datum) - typesof(/atom))
diff --git a/code/__HELPERS/typepaths/subtypesof_non_abstract.dm b/code/__HELPERS/typepaths/subtypesof_non_abstract.dm
new file mode 100644
index 000000000000..8c9f29d1ef52
--- /dev/null
+++ b/code/__HELPERS/typepaths/subtypesof_non_abstract.dm
@@ -0,0 +1,14 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/**
+ * Grabs all datum typepaths under a path that are not abstract.
+ *
+ * * Runtimes if path is not a datum.
+ */
+/proc/subtypesof_non_abstract(datum_path)
+ . = list()
+ for(var/datum/dpath as anything in (typesof(datum_path) - datum_path))
+ if(initial(dpath.abstract_type) == dpath)
+ continue
+ . += dpath
diff --git a/code/__HELPERS/typepaths/typesof_non_abstract.dm b/code/__HELPERS/typepaths/typesof_non_abstract.dm
new file mode 100644
index 000000000000..4554ee528610
--- /dev/null
+++ b/code/__HELPERS/typepaths/typesof_non_abstract.dm
@@ -0,0 +1,14 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/**
+ * Grabs all datum typepaths under a path that are not abstract.
+ *
+ * * Runtimes if path is not a datum.
+ */
+/proc/typesof_non_abstract(datum_path)
+ . = list()
+ for(var/datum/dpath as anything in typesof(datum_path))
+ if(initial(dpath.abstract_type) == dpath)
+ continue
+ . += dpath
From a540b792d0660f01aa742b0ed1f7f95cc64d8dc9 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:27:53 +0000
Subject: [PATCH 51/68] fix
---
.../factions/corporations/nanotrasen/items/guns/nt_isd.dm | 3 +++
code/modules/projectiles/guns/energy/special.dm | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index 895b937655e0..a2c2a9d7e896 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -119,6 +119,9 @@
/obj/projectile/nt_isd/electrode
name = "stun bolt"
+/obj/projectile/nt_isd/disable
+ name = "disabler beam"
+
// todo: this shouldn't be an emp, this should be like synthetik's
/obj/projectile/nt_isd/ion
name = "ion bolt"
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 80521a40f866..67a53180e428 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -216,7 +216,6 @@
cell_type = /obj/item/cell/device/weapon/recharge
legacy_battery_lock = 1
accuracy = 75 // Suppressive weapons don't work too well if there's no risk of being hit.
- burst_delay = 1 // Burst faster than average.
origin_tech = list(TECH_COMBAT = 6, TECH_MAGNET = 6, TECH_ILLEGAL = 6)
one_handed_penalty = 60
From ac0f86fd1787627b04da566ce0de9bb418e4caab Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:54:55 +0000
Subject: [PATCH 52/68] updates
---
citadel.dme | 1 +
code/__DEFINES/combat/armor.dm | 6 ++
code/__DEFINES/power/balancing.dm | 9 ++-
.../nanotrasen/items/guns/nt_isd.dm | 59 ++++++++++++++++---
.../nanotrasen/items/guns/nt_pulse.dm | 8 +--
code/modules/examine/examine.dm | 12 ++--
.../projectiles/guns/energy-firemode.dm | 6 ++
code/modules/projectiles/guns/firemode.dm | 3 +
.../projectiles/projectile/projectile.dm | 6 +-
9 files changed, 87 insertions(+), 23 deletions(-)
create mode 100644 code/modules/projectiles/guns/energy-firemode.dm
diff --git a/citadel.dme b/citadel.dme
index 374e1c62564d..d02b2be6aff5 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -4470,6 +4470,7 @@
#include "code\modules\projectiles\ammunition\calibers\special\pellet.dm"
#include "code\modules\projectiles\ammunition\calibers\special\rocket.dm"
#include "code\modules\projectiles\guns\ballistic.dm"
+#include "code\modules\projectiles\guns\energy-firemode.dm"
#include "code\modules\projectiles\guns\energy.dm"
#include "code\modules\projectiles\guns\firemode.dm"
#include "code\modules\projectiles\guns\firing_pin.dm"
diff --git a/code/__DEFINES/combat/armor.dm b/code/__DEFINES/combat/armor.dm
index 67ede87ad789..7b9db25ae1e9 100644
--- a/code/__DEFINES/combat/armor.dm
+++ b/code/__DEFINES/combat/armor.dm
@@ -38,6 +38,9 @@
#define ARMOR_FIRE "fire"
#define ARMOR_ACID "acid"
+/**
+ * All armor enums that can be stored in an armor datum
+ */
GLOBAL_REAL_LIST(armor_enums) = list(
ARMOR_MELEE,
ARMOR_MELEE_TIER,
@@ -59,6 +62,9 @@ GLOBAL_REAL_LIST(armor_enums) = list(
ARMOR_ACID,
)
+/**
+ * Actual armor types that can be checked for with `damage_flag`
+ */
GLOBAL_REAL_LIST(armor_types) = list(
ARMOR_MELEE,
ARMOR_BULLET,
diff --git a/code/__DEFINES/power/balancing.dm b/code/__DEFINES/power/balancing.dm
index d966ee58b549..873616268014 100644
--- a/code/__DEFINES/power/balancing.dm
+++ b/code/__DEFINES/power/balancing.dm
@@ -2,8 +2,6 @@
//* Cells
-/// the closest thing we'll get to a cvar - cellrate is kJ per cell unit. kJ to avoid float precision loss.
-GLOBAL_VAR_INIT(cellrate, 0.5)
/**
* current calculations
* cellrate 0.5 = 0.5 kj/unit
@@ -11,7 +9,14 @@ GLOBAL_VAR_INIT(cellrate, 0.5)
* 1 Wh = 60J-S*60s/m = 3600J = 3.6kJ
* 10k cell --> 1388.89 Wh
* damn, future cells be pogging
+ *
+ * * Funnily enough, this puts our cells at just about ~10x the capacity of modern day cells.
+ * That's pretty reasonable given they're meant to power energy weapons and hilariously
+ * sci-fi technologies.
*/
+
+/// the closest thing we'll get to a cvar - cellrate is kJ per cell unit. kJ to avoid float precision loss.
+GLOBAL_VAR_INIT(cellrate, 0.5)
/// the closest thing we'll get to a cvar - affects cell use_scaled - higher = things use less energy. handheld devices usually use this.
GLOBAL_VAR_INIT(cellefficiency, 1)
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index a2c2a9d7e896..f99848cc758f 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -2,6 +2,7 @@
//* Copyright (c) 2024 silicons *//
/datum/firemode/energy/nt_isd
+ abstract_type = /datum/firemode/energy/nt_isd
/**
* Weapons for NT's Internal Security.
@@ -12,10 +13,12 @@
* * There's probably a neat amount of these just floating around the Frontier now from losses.
*/
/obj/item/gun/energy/nt_isd
+ abstract_type = /obj/item/gun/energy/nt_isd
//* Energy Sidearm *//
/datum/firemode/energy/nt_isd/sidearm
+ abstract_type = /datum/firemode/energy/nt_isd/sidearm
/datum/firemode/energy/nt_isd/sidearm/stun
name = "disrupt"
@@ -33,12 +36,18 @@
name = "hybrid taser"
desc = "A versatile energy sidearm used by corporate security."
description_fluff = {""}
+ firemodes = list(
+ /datum/firemode/energy/nt_isd/sidearm/stun,
+ /datum/firemode/energy/nt_isd/sidearm/disable,
+ /datum/firemode/energy/nt_isd/sidearm/lethal,
+ )
#warn impl
//* Energy Carbine *//
/datum/firemode/energy/nt_isd/carbine
+ abstract_type = /datum/firemode/energy/nt_isd/carbine
/datum/firemode/energy/nt_isd/carbine/disable
name = "disable"
@@ -56,12 +65,18 @@
name = "energy carbine"
desc = "A versatile energy carbine used by corporate security."
description_fluff = {""}
+ firemodes = list(
+ /datum/firemode/energy/nt_isd/carbine/disable,
+ /datum/firemode/energy/nt_isd/carbine/shock,
+ /datum/firemode/energy/nt_isd/carbine/kill,
+ )
#warn impl
//* Energy Lance *//
/datum/firemode/energy/nt_isd/lance
+ abstract_type = /datum/firemode/energy/nt_isd/lance
/datum/firemode/energy/nt_isd/lance/kill
name = "kill"
@@ -71,6 +86,9 @@
name = "energy lance"
desc = "A particle rifle used by corporate security. Shoots focused particle beams."
description_fluff = {""}
+ firemodes = list(
+ /datum/firemode/energy/nt_isd/lance/kill,
+ )
#warn impl
@@ -93,38 +111,65 @@
/obj/item/gun/energy/nt_isd/multiphase
name = "multiphase sidearm"
- desc = "A sidearm as versatile as it is expensive."
+ desc = "A prototype sidearm for high-ranking corporate security."
description_fluff = {""}
+ firemodes = list(
+ /datum/firemode/energy/nt_isd/multiphase/disable,
+ /datum/firemode/energy/nt_isd/multiphase/kill,
+ /datum/firemode/energy/nt_isd/multiphase/ion,
+ )
#warn impl
//* Projectiles *//
/obj/projectile/nt_isd
-
-/obj/projectile/nt_isd/laser/sidearm
- name = "phaser blast"
+ abstract_type = /obj/projectile/nt_isd
/obj/projectile/nt_isd/laser
+ abstract_type = /obj/projectile/nt_isd/laser
+ damage_type = DAMAGE_TYPE_BURN
+
+/obj/projectile/nt_isd/laser/rifle
name = "laser"
+ damage_force = 40
+ damage_tier = LASER_TIER_MEDIUM
+
+/obj/projectile/nt_isd/laser/sidearm
+ name = "phaser blast"
+ damage_force = 20
+ damage_tier = LASER_TIER_HIGH
/obj/projectile/nt_isd/laser/multiphase
+ name = "focused laser"
+ damage_force = 40
+ damage_tier = LASER_TIER_HIGH
/obj/projectile/nt_isd/laser/lance
name = "particle beam"
+ damage_force = 30
+ damage_tier = LASER_TIER_HIGH
+
+#warn sprites for above
/obj/projectile/nt_isd/shock
name = "energy beam"
+ #warn impl
/obj/projectile/nt_isd/electrode
name = "stun bolt"
+ #warn impl
/obj/projectile/nt_isd/disable
name = "disabler beam"
+ #warn impl
// todo: this shouldn't be an emp, this should be like synthetik's
/obj/projectile/nt_isd/ion
name = "ion bolt"
-
-
-#warn impl all + sprites
+ base_projectile_effects = list(
+ /datum/projectile_effect/detonation/legacy_emp{
+ sev_2 = 1;
+ sev_3 = 2;
+ },
+ )
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
index 74da57e1b91e..b129c26f4f7d 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
@@ -25,12 +25,12 @@
/datum/firemode/energy/nt_pulse/rifle/laser
name = "laser"
render_key = "kill"
- settings = list(mode_name = "lethal", projectile_type = /obj/projectile/beam, charge_cost = 80)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam, charge_cost = 80)
/datum/firemode/energy/nt_pulse/rifle/pulse
name = "pulse"
render_key = "destroy"
- settings = list(mode_name = "destroy", projectile_type = /obj/projectile/beam/pulse, charge_cost = 180)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam/pulse, charge_cost = 180)
/obj/item/gun/energy/nt_pulse/rifle
prototype_id = "nt-pulse-rifle"
@@ -72,12 +72,12 @@
/datum/firemode/energy/nt_pulse/carbine/laser
name = "laser"
render_key = "kill"
- settings = list(mode_name = "lethal", projectile_type = /obj/projectile/beam, charge_cost = 120)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam, charge_cost = 120)
/datum/firemode/energy/nt_pulse/carbine/pulse
name = "pulse"
render_key = "destroy"
- settings = list(mode_name = "destroy", projectile_type = /obj/projectile/beam/pulse, charge_cost = 240)
+ legacy_direct_varedits = list(projectile_type = /obj/projectile/beam/pulse, charge_cost = 240)
/obj/item/gun/energy/nt_pulse/carbine
prototype_id = "nt-pulse-carbine"
diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm
index 72868544f8b7..fb31d33a324d 100644
--- a/code/modules/examine/examine.dm
+++ b/code/modules/examine/examine.dm
@@ -8,6 +8,8 @@
#define EXAMINE_PANEL_PADDING " "
/atom/
+ // todo: this is ass, we need a better help system.
+ // a combination system of screentips and examines, maybe?
var/description_info = null //Helpful blue text.
/**
@@ -26,14 +28,12 @@
* * This is appended at the end of [description_fluff]. Useful for things like "this is part of a group of similar blah blah blah's".
*/
var/description_fluff_categorizer
-
+ // todo: this is ass, find out a better way to give info via skills system and not special roles
var/description_antag = null //Malicious red text, for the antags.
//Override these if you need special behaviour for a specific type.
/atom/proc/get_description_info()
- if(description_info)
- return description_info
- return
+ return description_info
/atom/proc/get_description_fluff()
. = description_fluff
@@ -45,9 +45,7 @@
. = description_fluff_categorizer
/atom/proc/get_description_antag()
- if(description_antag)
- return description_antag
- return
+ return description_antag
// This one is slightly different, in that it must return a list.
/atom/proc/get_description_interaction(mob/user)
diff --git a/code/modules/projectiles/guns/energy-firemode.dm b/code/modules/projectiles/guns/energy-firemode.dm
new file mode 100644
index 000000000000..a406ff361185
--- /dev/null
+++ b/code/modules/projectiles/guns/energy-firemode.dm
@@ -0,0 +1,6 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/datum/firemode/energy
+ /// charge cost of using this in **joules**
+ var/energy_cost
diff --git a/code/modules/projectiles/guns/firemode.dm b/code/modules/projectiles/guns/firemode.dm
index 5555e1e396c1..f1acc9f5b8d8 100644
--- a/code/modules/projectiles/guns/firemode.dm
+++ b/code/modules/projectiles/guns/firemode.dm
@@ -16,6 +16,9 @@
//* rendering *//
/// state key for rendering, if any
var/render_key
+ /// firemode color, used if we're doing colored `-firemode` sprite or colored `-ammo` sprite
+ var/render_color
+ #warn impl
//* LEGACY *//
/// direct vv edits to the gun applied when we're selected.
diff --git a/code/modules/projectiles/projectile/projectile.dm b/code/modules/projectiles/projectile/projectile.dm
index 489ec2c9828c..ee0fbf1634c8 100644
--- a/code/modules/projectiles/projectile/projectile.dm
+++ b/code/modules/projectiles/projectile/projectile.dm
@@ -288,9 +288,9 @@
//? Damage - default handling
/// damage amount
- var/damage_force = 10
- /// damage tier - goes hand in hand with [damage_armor]
- var/damage_tier = BULLET_TIER_DEFAULT
+ var/damage_force = 0
+ /// damage tier - goes hand in hand with [damage_mode]
+ var/damage_tier = ARMOR_TIER_DEFAULT
/// damage type - DAMAGE_TYPE_* define
var/damage_type = DAMAGE_TYPE_BRUTE
/// armor flag for damage - goes hand in hand with [damage_tier]
From 8ee7d2df351a22ba5e29e7bda2ef96dac7274112 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 17:16:14 +0000
Subject: [PATCH 53/68] sigh
---
.../projectiles/guns/energy-firemode.dm | 32 +++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/code/modules/projectiles/guns/energy-firemode.dm b/code/modules/projectiles/guns/energy-firemode.dm
index a406ff361185..7813542be2a5 100644
--- a/code/modules/projectiles/guns/energy-firemode.dm
+++ b/code/modules/projectiles/guns/energy-firemode.dm
@@ -2,5 +2,33 @@
//* Copyright (c) 2024 Citadel Station Developers *//
/datum/firemode/energy
- /// charge cost of using this in **joules**
- var/energy_cost
+ //* Energy Usage *//
+
+ /// charge cost of using this in cell units.
+ var/charge_cost
+
+ //* Projectile Formation *//
+
+ //? Modular weapons make this complicated. The gun reserves the right to ?//
+ //? overrule the firemode as necessary. It would be optimal to separate ?//
+ //? firemodes from 'projectile modes', but it might be overkill given ?//
+ //? the majority of energy guns do not require this functionality. ?//
+
+ /// projectile type
+ var/projectile_type
+
+#warn deal with this
+
+// todo: this shouldn't even exist.
+/datum/firemode/energy/New(obj/item/gun/inherit_from_gun, list/direct_varedits)
+ ..()
+ if(!length(direct_varedits))
+ return
+ for(var/varname in direct_varedits)
+ var/value = direct_varedits[varname]
+ // pull out special crap
+ switch(varname)
+ if("charge_cost")
+ src.charge_cost = value
+ if("projectile_type")
+ src.projectile_type = value
From 84e7296c13136ab5c522d7dccd4f01f1a53fd207 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 18:47:04 +0000
Subject: [PATCH 54/68] list-clone
---
code/__HELPERS/lists/clone.dm | 37 +++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 code/__HELPERS/lists/clone.dm
diff --git a/code/__HELPERS/lists/clone.dm b/code/__HELPERS/lists/clone.dm
new file mode 100644
index 000000000000..3e81d400c62a
--- /dev/null
+++ b/code/__HELPERS/lists/clone.dm
@@ -0,0 +1,37 @@
+/**
+ * Makes a deep clone of a list.
+ *
+ * * Any datum-types in the list must have clone() implemented.
+ * * This is somewhat expensive. Use sparingly.
+ *
+ * Valid datatypes that can be cloned:
+ *
+ * * numbers
+ * * strings
+ * * lists
+ * * datums with clone() implemented
+ */
+/proc/deep_clone_list(list/L)
+ var/list/copy = L.Copy()
+ for(var/i in 1 to length(copy))
+ var/key = copy[i]
+ var/value = copy[key]
+ // clone key
+ key = deep_clone_value(key)
+ copy[i] = key
+ // clone value if it's there
+ if(isnull(value))
+ continue
+ copy[key] = deep_clone_value(value)
+ return copy
+
+/proc/deep_clone_value(val)
+ if(isnum(val) || istext(val))
+ return val
+ else if(islist(val))
+ return deep_clone_list(val)
+ else if(isdatum(val))
+ var/datum/casted = val
+ return casted.clone()
+ // unimplemented otherwise.
+ return null
From d6c96b7e1d75b6bfb46ae86e02f8936f6bcdb4d1 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 22:32:22 +0000
Subject: [PATCH 55/68] updates
---
citadel.dme | 1 +
.../nanotrasen/items/guns/nt_isd.dm | 31 ++++++++++-
.../nanotrasen/items/guns/nt_pulse.dm | 17 ++++--
.../projectiles/guns/energy-firemode.dm | 19 +++----
code/modules/projectiles/guns/energy/laser.dm | 55 ++++++++++++-------
code/modules/projectiles/guns/energy/stun.dm | 17 +++---
code/modules/projectiles/guns/firemode.dm | 12 ++++
code/modules/projectiles/guns/gun.dm | 46 +++++++++++++++-
.../guns/gun_component/energy_handler.dm | 2 +-
.../projectile/subtypes/beam/beams.dm | 1 +
.../projectile/subtypes/energy/energy.dm | 8 +--
11 files changed, 159 insertions(+), 50 deletions(-)
diff --git a/citadel.dme b/citadel.dme
index d02b2be6aff5..bb8cea7201c8 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -429,6 +429,7 @@
#include "code\__HELPERS\lists\asset_sorted.dm"
#include "code\__HELPERS\lists\associations.dm"
#include "code\__HELPERS\lists\bitflag_lists.dm"
+#include "code\__HELPERS\lists\clone.dm"
#include "code\__HELPERS\lists\copy.dm"
#include "code\__HELPERS\lists\counter.dm"
#include "code\__HELPERS\lists\json.dm"
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index f99848cc758f..4b97222230c0 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -11,6 +11,15 @@
* * Expensive
* * Joint with Hephaestus / Vey-Med, canonically
* * There's probably a neat amount of these just floating around the Frontier now from losses.
+ *
+ * Things to keep in mind:
+ *
+ * * Stun does not mean something is cheap as, or cheaper than, lethal.
+ * * Stun in this codebase is not treated as any special or even preferable damage type.
+ * * Nanotrasen uses stun weaponry for arrests, but in-canon security is rarely having to
+ * use physical and ranged force against other employees.
+ * * Stun weapons should generally be worse at stunning than lethal modes of that weapon
+ * are at downing someone who is armored.
*/
/obj/item/gun/energy/nt_isd
abstract_type = /obj/item/gun/energy/nt_isd
@@ -23,14 +32,20 @@
/datum/firemode/energy/nt_isd/sidearm/stun
name = "disrupt"
render_color = "#ffff00"
+ charge_cost = 2400 / 8
+ projectile_type = /obj/projectile/nt_isd/electrode
/datum/firemode/energy/nt_isd/sidearm/disable
name = "disable"
render_color = "#77ffff"
+ charge_cost = 2400 / 20
+ projectile_type = /obj/projectile/nt_isd/disable
/datum/firemode/energy/nt_isd/sidearm/lethal
name = "kill"
render_color = "#ff0000"
+ charge_cost = 2400 / 15
+ projectile_type = /obj/projectile/nt_isd/laser/sidearm
/obj/item/gun/energy/nt_isd/sidearm
name = "hybrid taser"
@@ -52,14 +67,20 @@
/datum/firemode/energy/nt_isd/carbine/disable
name = "disable"
render_color = "#77ffff"
+ charge_cost = 2400 / 20
+ projectile_type = /obj/projectile/nt_isd/disable
/datum/firemode/energy/nt_isd/carbine/shock
name = "shock"
render_color = "#ffff00"
+ charge_cost = 2400 / 10
+ projectile_type = /obj/projectile/nt_isd/shock
/datum/firemode/energy/nt_isd/carbine/kill
name = "kill"
render_color = "#ff0000"
+ charge_cost = 2400 / 10
+ projectile_type = /obj/projectile/nt_isd/laser/rifle
/obj/item/gun/energy/nt_isd/carbine
name = "energy carbine"
@@ -81,6 +102,8 @@
/datum/firemode/energy/nt_isd/lance/kill
name = "kill"
render_color = "#00ff00"
+ charge_cost = 2400 / 12
+ projectile_type = /obj/projectile/nt_isd/laser/lance
/obj/item/gun/energy/nt_isd/lance
name = "energy lance"
@@ -99,15 +122,21 @@
/datum/firemode/energy/nt_isd/multiphase/disable
name = "disable"
render_color = "#77ffff"
+ projectile_type = /obj/projectile/nt_isd/disable
+ charge_cost = 2400 / 20
/datum/firemode/energy/nt_isd/multiphase/kill
name = "kill"
render_color = "#ff0000"
+ projectile_type = /obj/projectile/nt_isd/laser/multiphase
+ charge_cost = 2400 / 12
// todo: this is an ion beam, not an EMP pulse
/datum/firemode/energy/nt_isd/multiphase/ion
name = "ion"
render_color = "#456aaa"
+ projectile_type = /obj/projectile/nt_isd/ion
+ charge_cost = 2400 / 5
/obj/item/gun/energy/nt_isd/multiphase
name = "multiphase sidearm"
@@ -138,7 +167,7 @@
/obj/projectile/nt_isd/laser/sidearm
name = "phaser blast"
damage_force = 20
- damage_tier = LASER_TIER_HIGH
+ damage_tier = LASER_TIER_HIGH // ;)
/obj/projectile/nt_isd/laser/multiphase
name = "focused laser"
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
index b129c26f4f7d..c691e74d339d 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pulse.dm
@@ -25,12 +25,16 @@
/datum/firemode/energy/nt_pulse/rifle/laser
name = "laser"
render_key = "kill"
- legacy_direct_varedits = list(projectile_type = /obj/projectile/beam, charge_cost = 80)
+ // todo: function of defines for weapon cell standard capacities
+ charge_cost = 80
+ projectile_type = /obj/projectile/beam
/datum/firemode/energy/nt_pulse/rifle/pulse
name = "pulse"
render_key = "destroy"
- legacy_direct_varedits = list(projectile_type = /obj/projectile/beam/pulse, charge_cost = 180)
+ // todo: function of defines for weapon cell standard capacities
+ charge_cost = 160
+ projectile_type = /obj/projectile/beam/pulse
/obj/item/gun/energy/nt_pulse/rifle
prototype_id = "nt-pulse-rifle"
@@ -72,12 +76,16 @@
/datum/firemode/energy/nt_pulse/carbine/laser
name = "laser"
render_key = "kill"
- legacy_direct_varedits = list(projectile_type = /obj/projectile/beam, charge_cost = 120)
+ // todo: function of defines for weapon cell standard capacities
+ charge_cost = 120
+ projectile_type = /obj/projectile/beam
/datum/firemode/energy/nt_pulse/carbine/pulse
name = "pulse"
render_key = "destroy"
- legacy_direct_varedits = list(projectile_type = /obj/projectile/beam/pulse, charge_cost = 240)
+ // todo: function of defines for weapon cell standard capacities
+ charge_cost = 240
+ projectile_type = /obj/projectile/beam/pulse
/obj/item/gun/energy/nt_pulse/carbine
prototype_id = "nt-pulse-carbine"
@@ -126,3 +134,4 @@
/obj/projectile/beam/pulse/shotgun
damage_force = 50
armor_penetration = 25
+XTREME
diff --git a/code/modules/projectiles/guns/energy-firemode.dm b/code/modules/projectiles/guns/energy-firemode.dm
index 7813542be2a5..7b79f3eeacc0 100644
--- a/code/modules/projectiles/guns/energy-firemode.dm
+++ b/code/modules/projectiles/guns/energy-firemode.dm
@@ -3,21 +3,14 @@
/datum/firemode/energy
//* Energy Usage *//
-
/// charge cost of using this in cell units.
var/charge_cost
-
- //* Projectile Formation *//
-
- //? Modular weapons make this complicated. The gun reserves the right to ?//
- //? overrule the firemode as necessary. It would be optimal to separate ?//
- //? firemodes from 'projectile modes', but it might be overkill given ?//
- //? the majority of energy guns do not require this functionality. ?//
+ #warn impl
+ //* Projectile Formation *//
/// projectile type
var/projectile_type
-
-#warn deal with this
+ #warn impl
// todo: this shouldn't even exist.
/datum/firemode/energy/New(obj/item/gun/inherit_from_gun, list/direct_varedits)
@@ -32,3 +25,9 @@
src.charge_cost = value
if("projectile_type")
src.projectile_type = value
+
+/datum/firemode/energy/clone(include_contents)
+ var/datum/firemode/energy/cloning = ..()
+ cloning.charge_cost = charge_cost
+ cloning.projectile_type = projectile_trajectory
+ return cloning
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index a6fd1b888c02..30a6335a9ccd 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -1,3 +1,18 @@
+/datum/firemode/energy/laser_rifle
+ abstract_type = /datum/firemode/energy/laser_rifle
+
+/datum/firemode/energy/laser_rifle/normal
+ name = "normal"
+ cycle_cooldown = 0.8 SECONDS
+ projectile_type = /obj/projectile/beam/midlaser
+ charge_cost = 2400 / 10
+
+/datum/firemode/energy/laser_rifle/suppression
+ name = "suppressive"
+ cycle_cooldown = 0.4 SECONDS
+ projectile_type = /obj/projectile/beam/weaklaser
+ charge_cost = 2400 / 40
+
/obj/item/gun/energy/laser
name = "laser rifle"
desc = "A Hephaestus Industries G40E rifle, designed to kill with concentrated energy blasts. This variant has the ability to \
@@ -5,23 +20,15 @@
icon_state = "laser"
item_state = "laser"
wielded_item_state = "laser-wielded"
- fire_delay = 8
slot_flags = SLOT_BELT|SLOT_BACK
w_class = WEIGHT_CLASS_BULKY
damage_force = 10
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2)
materials_base = list(MAT_STEEL = 2000)
- projectile_type = /obj/projectile/beam/midlaser
heavy = TRUE
one_handed_penalty = 30
-
worth_intrinsic = 350
- firemodes = list(
- list(mode_name="normal", fire_delay=8, projectile_type=/obj/projectile/beam/midlaser, charge_cost = 240),
- list(mode_name="suppressive", fire_delay=5, projectile_type=/obj/projectile/beam/weaklaser, charge_cost = 60),
- )
-
/obj/item/gun/energy/laser/mounted
self_recharge = 1
use_external_power = 1
@@ -34,15 +41,13 @@
/obj/item/gun/energy/laser/practice
name = "practice laser carbine"
desc = "A modified version of the HI G40E, this one fires less concentrated energy bolts designed for target practice."
- projectile_type = /obj/projectile/beam/practice
- charge_cost = 48
-
- cell_type = /obj/item/cell/device
- firemodes = list(
- list(mode_name="normal", projectile_type=/obj/projectile/beam/practice, charge_cost = 48),
- list(mode_name="suppressive", projectile_type=/obj/projectile/beam/practice, charge_cost = 12),
- )
+ firemodes = /datum/firemode/energy{
+ name = "normal";
+ projectile_type = /obj/projectile/beam/practice;
+ charge_cost = 2400 / 80;
+ cycle_cooldown = 0.4 SECONDS;
+ }
/obj/item/gun/energy/retro
name = "retro laser"
@@ -51,8 +56,13 @@
desc = "An older model of the basic lasergun. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
slot_flags = SLOT_BELT
w_class = WEIGHT_CLASS_NORMAL
- projectile_type = /obj/projectile/beam
- fire_delay = 10 //old technology
+
+ firemodes = /datum/firemode/energy{
+ name = "normal";
+ charge_cost = 2400 / 10;
+ projectile_type = /obj/projectile/beam;
+ cycle_cooldown = 1 SECONDS;
+ }
/obj/item/gun/energy/retro/mounted
self_recharge = 1
@@ -101,10 +111,13 @@
catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_pistol)
icon_state = "alienpistol"
item_state = "alienpistol"
- fire_delay = 10 // Handguns should be inferior to two-handed weapons. Even alien ones I suppose.
- charge_cost = 240 // Ten shots.
- projectile_type = /obj/projectile/beam/cyan
+ firemodes = /datum/firemode/energy {
+ projectile_type = /obj/projectile/beam/cyan;
+ charge_cost = 2400 / 10;
+ cycle_cooldown = 1 SECONDS;
+ }
+
cell_type = /obj/item/cell/device/weapon/recharge/alien // Self charges.
origin_tech = list(TECH_COMBAT = 8, TECH_MAGNET = 7)
modifystate = "alienpistol"
diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm
index d8cd3211e14b..4228596e3adb 100644
--- a/code/modules/projectiles/guns/energy/stun.dm
+++ b/code/modules/projectiles/guns/energy/stun.dm
@@ -91,9 +91,11 @@
icon_state = "plasma_stun"
item_state = "plasma_stun"
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_POWER = 3)
- fire_delay = 20
- charge_cost = 600
- projectile_type = /obj/projectile/energy/plasmastun
+ firemodes = /datum/firemode/energy{
+ projectile_type = /obj/projectile/energy/plasmastun;
+ cycle_cooldown = 2 SECONDS;
+ charge_cost = 2400 / 4;
+ }
one_handed_penalty = 5
/obj/item/gun/energy/civtas
@@ -102,7 +104,8 @@
icon_state = "civtas"
item_state = "concealed"
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 3, TECH_POWER = 3)
- projectile_type = /obj/projectile/energy/electrode/stunshot
- fire_delay = 4
- charge_cost = 1500
- cell_type = /obj/item/cell/device/weapon
+ firemodes = /datum/firemode/energy{
+ projectile_type = /obj/projectile/energy/electrode/stunshot;
+ cycle_cooldown = 0.4 SECONDS;
+ charge_cost = 2400 / 2;
+ }
diff --git a/code/modules/projectiles/guns/firemode.dm b/code/modules/projectiles/guns/firemode.dm
index f1acc9f5b8d8..f5757a4fef0d 100644
--- a/code/modules/projectiles/guns/firemode.dm
+++ b/code/modules/projectiles/guns/firemode.dm
@@ -47,6 +47,18 @@
src.burst_delay = value
LAZYSET(legacy_direct_varedits, varname, value || inherit_from_gun.vars[varname])
+/datum/firemode/clone(include_contents)
+ var/datum/firemode/creating = new type
+ creating.name = name
+ creating.burst_amount = burst_amount
+ creating.burst_delay = burst_delay
+ creating.cycle_cooldown = cycle_cooldown
+ creating.render_color = render_color
+ creating.render_key = render_key
+ // todo: kill
+ creating.legacy_direct_varedits = deep_copy_list(legacy_direct_varedits)
+ return creating
+
// todo: annihilate this
/datum/firemode/proc/apply_legacy_variables(obj/item/gun/gun)
for(var/varname in legacy_direct_varedits)
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 02c8dd80405f..9b5f219c6eba 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -1,11 +1,38 @@
/**
- * Guns
+ * # Guns
*
* A gun is a weapon that can be aimed and fired at someone or something over a distance.
*
+ * todo: /obj/item/gun/projectile vs /obj/item/gun/launcher,
+ * instead of have projectile be on /obj/item/gun
*
- * todo: /obj/item/gun/projectile vs /obj/item/gun/launcher
+ * ## Hotkey Priority
+ *
+ * The usable semantic hotkeys for guns are: Z, Spacebar, F, G.
+ * F, G are avoided as 'unique defensives' and something components
+ * need to be able to register to.
+ *
+ * todo: At some point, we'll need proper hotkey priority handling for items
+ * for the 'primary semantic keys' like active key/spacebar,
+ * F and G. For now, it's kind of a wild west where items define
+ * Z and Spacebar and F/G are usually component-hooked.
+ *
+ * The problem comes in that guns have **three** self-actions instead of two:
+ * - Wielding
+ * - Racking / chamber charging
+ * - Firemode switch
+ *
+ * This is annoying because semantically, the Z key should always have wielding,
+ * Spacebar should have racking behaviors if they exist, which means we don't
+ * have a spot for firemode switching.
+ *
+ * As of right now, wielding is not on all guns but that will change very soon.
+ * todo: Change that very soon.
+ * This means that Z key will never be available to guns for firemode switches.
+ *
+ * For now, we're winging it. This is just design notes for when we cross
+ * this hellish bridge.
*/
/obj/item/gun
name = "gun"
@@ -271,6 +298,8 @@
modular_component_slots[GUN_COMPONENT_INTERNAL_MODULE] = modular_component_slots_internal
modular_component_slots = typelist(NAMEOF(src, modular_component_slots), modular_component_slots)
+ #warn firemode action if needed
+
/obj/item/gun/examine(mob/user, dist)
. = ..()
if(!no_pin_required)
@@ -722,6 +751,19 @@
/obj/item/gun/proc/get_ammo_ratio()
return 0
+//* Firemodes *//
+
+/**
+ * Ensures our firemodes list is not a cached copy.
+ *
+ * * This absolutely must be called before **any** mutating writes to
+ * `firemodes` or its contents.
+ */
+/obj/item/gun/proc/ensure_firemodes_owned()
+ if(!is_typelist(NAMEOF(src, firemodes), firemodes))
+ return
+ firemodes = deep_clone_list(firemodes)
+
//* Rendering *//
/obj/item/gun/update_icon(updates)
diff --git a/code/modules/projectiles/guns/gun_component/energy_handler.dm b/code/modules/projectiles/guns/gun_component/energy_handler.dm
index 3f07ff52a76d..779920af2893 100644
--- a/code/modules/projectiles/guns/gun_component/energy_handler.dm
+++ b/code/modules/projectiles/guns/gun_component/energy_handler.dm
@@ -11,7 +11,7 @@
An uncommon energy handler. Requires the user to rack the weapon to recharge
a linked supercapacitor array between shots for fast operation. In return,
the power provided to a given shot is improved by a decent margin.
- "}
+ "}
/obj/item/gun_component/energy_handler/active_reload/summarize_bullet_points(datum/event_args/actor/actor, range)
. = list()
diff --git a/code/modules/projectiles/projectile/subtypes/beam/beams.dm b/code/modules/projectiles/projectile/subtypes/beam/beams.dm
index 98dd6dfc4af1..c85d30c01a75 100644
--- a/code/modules/projectiles/projectile/subtypes/beam/beams.dm
+++ b/code/modules/projectiles/projectile/subtypes/beam/beams.dm
@@ -89,6 +89,7 @@
icon_state = "cyan"
fire_sound = 'sound/weapons/weaponsounds_alienlaser.ogg'
damage_force = 40
+ damage_tier = LASER_TIER_HIGH
light_color = "#00C6FF"
muzzle_type = /obj/effect/projectile/muzzle/laser_omni
diff --git a/code/modules/projectiles/projectile/subtypes/energy/energy.dm b/code/modules/projectiles/projectile/subtypes/energy/energy.dm
index 4d9acec111be..a32077cddf71 100644
--- a/code/modules/projectiles/projectile/subtypes/energy/energy.dm
+++ b/code/modules/projectiles/projectile/subtypes/energy/energy.dm
@@ -181,12 +181,12 @@
var/ear_safety = 0
ear_safety = M.get_ear_protection()
if(ear_safety == 1)
- M.Confuse(150)
+ M.Confuse(6)
else if (ear_safety > 1)
- M.Confuse(30)
+ M.Confuse(3)
else if (!ear_safety)
- M.afflict_stun(20 * 10)
- M.afflict_paralyze(20 * 2)
+ M.afflict_stun(2 SECONDS)
+ M.afflict_paralyze(0.5 SECONDS)
M.ear_damage += rand(1, 10)
M.ear_deaf = max(M.ear_deaf,15)
if (M.ear_damage >= 15)
From be585f40c3d8f26b610dd0e2f6cab556690dead7 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 20:38:11 -0500
Subject: [PATCH 56/68] signals
---
citadel.dme | 4 +
.../dcs/signals/items/signals_gun.dm | 17 ++
.../nanotrasen/items/guns/nt_isd.dm | 2 +-
.../nanotrasen/items/guns/nt_pmd.dm | 64 +++++
.../nanotrasen/items/guns/nt_protomag-ammo.dm | 263 +++++++++++++++++
.../items/guns/nt_protomag-caliber.dm | 9 +
.../nanotrasen/items/guns/nt_protomag.dm | 267 +-----------------
.../projectiles/guns/energy/special.dm | 48 ----
code/modules/projectiles/guns/firemode.dm | 8 +
code/modules/projectiles/guns/gun-firing.dm | 16 +-
code/modules/projectiles/guns/gun.dm | 3 +
11 files changed, 385 insertions(+), 316 deletions(-)
create mode 100644 code/__DEFINES/dcs/signals/items/signals_gun.dm
create mode 100644 code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm
create mode 100644 code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
create mode 100644 code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-caliber.dm
diff --git a/citadel.dme b/citadel.dme
index bb8cea7201c8..51435c609abf 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -183,6 +183,7 @@
#include "code\__DEFINES\dcs\signals\datums\signals_beam_legacy.dm"
#include "code\__DEFINES\dcs\signals\datums\signals_perspective.dm"
#include "code\__DEFINES\dcs\signals\elements\signals_element_conflict_checking.dm"
+#include "code\__DEFINES\dcs\signals\items\signals_gun.dm"
#include "code\__DEFINES\dcs\signals\items\signals_inducer.dm"
#include "code\__DEFINES\dcs\signals\modules\signals_module_fishing.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom-buckling.dm"
@@ -1100,6 +1101,9 @@
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_expeditionary-light_sidearm.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_expeditionary.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_isd.dm"
+#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_pmd.dm"
+#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag-ammo.dm"
+#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag-caliber.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_pulse.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\animals.dm"
diff --git a/code/__DEFINES/dcs/signals/items/signals_gun.dm b/code/__DEFINES/dcs/signals/items/signals_gun.dm
new file mode 100644
index 000000000000..fc7d58161d45
--- /dev/null
+++ b/code/__DEFINES/dcs/signals/items/signals_gun.dm
@@ -0,0 +1,17 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/**
+ * Called before every fire() call, with (datum/gun_firing_cycle/cycle).
+ */
+#define COMSIG_GUN_FIRING_CYCLE_ITERATION_PREFIRE "gun-firing-iteration"
+
+/**
+ * Called before initiation of a firing cycle, with (datum/gun_firing_cycle/cycle).
+ */
+#define COMSIG_GUN_FIRING_CYCLE_START "gun-firing-start"
+
+/**
+ * Called on end of a firing cycle, with (datum/gun_firing_cycle/cycle).
+ */
+#define COMSIG_GUN_FIRING_CYCLE_END "gun-firing-end"
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index 4b97222230c0..886cfab38589 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -1,5 +1,5 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/datum/firemode/energy/nt_isd
abstract_type = /datum/firemode/energy/nt_isd
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm
new file mode 100644
index 000000000000..3d2147344917
--- /dev/null
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm
@@ -0,0 +1,64 @@
+
+
+/**
+ * Transforming service weapon for the Nanotrasen PMD. Sprites & work by Captain277.
+ */
+
+/datum/firemode/energy/nt_pmd/service_revolver
+ abstract_type = /datum/firemode/energy/nt_pmd/service_revolver
+ cycle_cooldown = 0.4 SECONDS
+
+/datum/firemode/energy/nt_pmd/service_revolver/normal
+ name = "normal"
+ projectile_type = /obj/projectile/bullet/pistol/medium/silver
+ charge_cost = 2400 / 8
+ radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-normal")
+
+/datum/firemode/energy/nt_pmd/service_revolver/shatter
+ name = "shatter"
+ projectile_type = /obj/projectile/bullet/pellet/shotgun/silvershot
+ cycle_cooldown = 1.5 SECONDS
+ charge_cost = 2400 / 5
+ radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-shatter")
+
+/datum/firemode/energy/nt_pmd/service_revolver/spin
+ name = "spin"
+ projectile_type = /obj/projectile/bullet/pistol/spin
+ cycle_cooldown = 0.1 SECONDS
+ charge_cost = 2400 / 80
+ radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-spin")
+
+/datum/firemode/energy/nt_pmd/service_revolver/pierce
+ name = "pierce"
+ projectile_type = /obj/projectile/bullet/rifle/a762/ap/silver
+ cycle_cooldown = 1.5 SECONDS
+ charge_cost = 2400 / 5
+ radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-pierce")
+
+/datum/firemode/energy/nt_pmd/service_revolver/charge
+ name = "charge"
+ projectile_type = /obj/projectile/bullet/burstbullet/service
+ cycle_cooldown = 2 SECONDS
+ charge_cost = 2400 / 4
+ radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-charge")
+
+/obj/item/gun/energy/nt_pmd/service_revolver
+ name = "service weapon"
+ icon_state = "service_grip"
+ #warn rename icon states, move icon over.
+ desc = "An anomalous weapon, long kept secure. It has recently been acquired by Nanotrasen's Paracausal Monitoring Division. How did it get here?"
+ damage_force = 5
+ slot_flags = SLOT_BELT
+ w_class = WEIGHT_CLASS_NORMAL
+ origin_tech = null
+ cell_type = /obj/item/cell/device/weapon/recharge/captain
+ legacy_battery_lock = 1
+ one_handed_penalty = 0
+ safety_state = GUN_SAFETY_OFF
+ firemodes = list(
+ /datum/firemode/energy/nt_pmd/service_revolver/normal,
+ /datum/firemode/energy/nt_pmd/service_revolver/shatter,
+ /datum/firemode/energy/nt_pmd/service_revolver/spin,
+ /datum/firemode/energy/nt_pmd/service_revolver/pierce,
+ /datum/firemode/energy/nt_pmd/service_revolver/charge,
+ )
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
new file mode 100644
index 000000000000..fe7c60c14dff
--- /dev/null
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
@@ -0,0 +1,263 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+//* -- Ammo & Projectiles -- *//
+
+//* Base *//
+
+/obj/item/ammo_casing/nt_protomag
+ name = "protomag casing"
+ desc = "An obnoxiously long casing for some kind of rifle."
+ caliber = /datum/ammo_caliber/nt_protomag
+
+/obj/projectile/bullet/nt_protomag
+ #warn impl all
+
+#warn impl all, with boxes, and colors. how?
+
+//* Hybrid Rounds *//
+
+/obj/item/ammo_casing/nt_protomag/magboosted
+ name = "protomag round"
+ desc = "A slender bullet. It seems to have less propellant than usual."
+ casing_primer = CASING_PRIMER_MAGNETIC | CASING_PRIMER_CHEMICAL
+
+// Normal
+
+/obj/item/ammo_casing/nt_protomag/magboosted/standard
+ projectile_type = /obj/projectile/nt_protomag/standard
+
+/obj/item/ammo_magazine/nt_protomag/box/standard
+ name = "protomag ammo box (standard)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/standard
+
+/obj/projectile/nt_protomag/standard
+
+// Armor Piercing
+
+/obj/item/ammo_casing/nt_protomag/magboosted/sabot
+ name = "protomag round (sabot)"
+ desc = "A slender bullet. While lacking in stopping power, this round is designed to punch through thicker than usual armor."
+
+ projectile_type = /obj/projectile/nt_protomag/sabot
+
+/obj/item/ammo_magazine/nt_protomag/box/sabot
+ name = "protomag ammo box (sabot)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/sabot
+
+/obj/projectile/bullet/nt_protomag/sabot
+ name = "magnetic slug"
+
+// Hollow Point
+
+// todo: this is currently disabled as medcode is not verbose enough for this to work
+// /obj/item/ammo_casing/nt_protomag/magboosted/shredder
+// name = "protomag round (shredder)"
+// desc = "A slender bullet. While lacking in penetration, this round is designed to shred soft targets with ease."
+//
+// projectile_type = /obj/projectile/nt_protomag/shredder
+
+// /obj/item/ammo_magazine/nt_protomag/box/shredder
+// name = "protomag ammo box (shredder)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/shredder
+
+// /obj/projectile/bullet/nt_protomag/shredder
+// name = "fragmenting slug"
+
+// 'Rubber'
+
+/obj/item/ammo_casing/nt_protomag/magboosted/impact
+ name = "protomag round (impact)"
+ desc = "A slender bullet. This round is the magnetic equivalent of a beanbag. That said, it would be a bad idea to detain someone with a railgun, beanbag or not."
+
+ projectile_type = /obj/projectile/nt_protomag/impact
+
+/obj/item/ammo_magazine/nt_protomag/box/impact
+ name = "protomag ammo box (impact)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/impact
+
+/obj/projectile/bullet/nt_protomag/impact
+ name = "deforming slug"
+
+// Practice
+
+/obj/item/ammo_casing/nt_protomag/magboosted/practice
+ name = "protomag round (practice)"
+ desc = "A slender bullet. This round is just a practice round. While it is made out of relatively soft materials, you should still try to not get shot by this."
+
+ projectile_type = /obj/projectile/nt_protomag/practice
+
+/obj/item/ammo_magazine/nt_protomag/box/practice
+ name = "protomag ammo box (practice)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/practice
+
+/obj/projectile/bullet/nt_protomag/practice
+ name = "lightweight slug"
+
+//* Magnetic Rounds *//
+
+/obj/item/ammo_casing/nt_protomag/magnetic
+ name = "protomag slug"
+ desc = "A slender ferromagnetic slug. A bullet without propellant, for whatever reason."
+ casing_primer = CASING_PRIMER_MAGNETIC
+
+// Smoke
+
+/obj/item/ammo_casing/nt_protomag/magnetic/smoke
+ name = "protomag slug (smoke)"
+ desc = "A slender ferromagnetic slug. While lacking in penetration, this round releases a light smokescreen on impact."
+
+ projectile_type = /obj/projectile/nt_protomag/smoke
+
+/obj/item/ammo_magazine/nt_protomag/box/smoke
+ name = "protomag ammo box (smoke)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/smoke
+
+/obj/projectile/bullet/nt_protomag/smoke
+ name = "disintegrating slug"
+
+// Ion
+
+/obj/item/ammo_casing/nt_protomag/magnetic/emp
+ name = "protomag slug (emp)"
+ desc = "A slender ferromagnetic slug. While lacking in penetration, this round releases a small electromagnetic burst on impact."
+
+ projectile_type = /obj/projectile/nt_protomag/emp
+
+/obj/item/ammo_magazine/nt_protomag/box/emp
+ name = "protomag ammo box (emp)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/emp
+
+/obj/projectile/bullet/nt_protomag/emp
+ name = "ion slug"
+ base_projectile_effects = list(
+ /datum/projectile_effect/detonation/legacy_emp{
+ sev_3 = 2;
+ }
+ )
+
+// Concussive
+
+// todo: this is currently disabled as simplemobs are not complex-AI enough for us to do this, and we don't need a PVP-only tool
+// /obj/item/ammo_casing/nt_protomag/magnetic/concussive
+// name = "protomag slug (concussive)"
+// desc = "A slender ferromagnetic slug. While lacking in penetration, this round contains a small airburst charge that detonates on impact."
+
+// projectile_type = /obj/projectile/nt_protomag/concussive
+
+// /obj/item/ammo_magazine/nt_protomag/box/concussive
+// name = "protomag ammo box (concussive)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/concussive
+
+// /obj/projectile/bullet/nt_protomag/concussive
+// name = "concussive slug"
+
+// Pierce
+
+/obj/item/ammo_casing/nt_protomag/magnetic/penetrator
+ name = "protomag slug (penetrator)"
+ desc = "A slender ferromagnetic slug. This one is made out of dense alloys, and is designed to punch through materials with ease. This round has very high recoil, as well as power draw."
+
+ projectile_type = /obj/projectile/nt_protomag/penetrator
+
+/obj/item/ammo_magazine/nt_protomag/box/penetrator
+ name = "protomag ammo box (penetrator)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/penetrator
+
+/obj/projectile/bullet/nt_protomag/penetrator
+ name = "high-velocity slug"
+
+// 'Stun'
+
+/obj/item/ammo_casing/nt_protomag/magnetic/shock
+ name = "protomag slug (shock)"
+ desc = "A slender ferromagnetic slug. This one is designed to release a burst of energy on imapct for less-than-lethal takedowns. That said, it would probably still be a bad idea to detain someone with a railgun slug."
+
+ projectile_type = /obj/projectile/nt_protomag/shock
+
+/obj/item/ammo_magazine/nt_protomag/box/shock
+ name = "protomag ammo box (shock)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/shock
+
+/obj/projectile/bullet/nt_protomag/shock
+ name = "piezo slug"
+
+// Light
+
+/obj/item/ammo_casing/nt_protomag/magnetic/flare
+ name = "protomag slug (flare)"
+ desc = "A slender ferromagnetic slug. Shatters into a lingering chemical illuminant on impact."
+
+ projectile_type = /obj/projectile/nt_protomag/flare
+
+/obj/item/ammo_magazine/nt_protomag/box/flare
+ name = "protomag ammo box (flare)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/flare
+
+/obj/projectile/bullet/nt_protomag/flare
+ name = "tracer shot"
+
+// todo: fuck no, rework fire stacks / fire first, holy crap; even then this should take multiple hits to ignite.
+// /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
+// name = "protomag slug (incendiary)"
+// desc = "A slender ferromagnetic slug. With almost no penetrating power whatsoever, this round is designed to explode into an incendiary material on impact"
+
+// projectile_type = /obj/projectile/nt_protomag/incendiary
+
+// /obj/item/ammo_magazine/nt_protomag/box/incendiary
+// name = "protomag ammo box (incendiary)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
+
+// /obj/projectile/bullet/nt_protomag/incendiary
+// name = "incendiary slug"
+
+// todo: fuck no, not until chloral and chemicals are reworked; this round is meant to take like 2-3 units maximum, on that note.
+// /obj/item/ammo_casing/nt_protomag/magnetic/reagent
+// name = "protomag slug (chemical)"
+// desc = "A slender ferromagnetic slug. Can be laced with a small amount of reagents, which will then splash onto and be injected into a hit target."
+
+// projectile_type = /obj/projectile/nt_protomag/reagent
+
+// /obj/item/ammo_magazine/nt_protomag/box/reagent
+// name = "protomag ammo box (reagent)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/reagent
+
+// /obj/projectile/bullet/nt_protomag/reagent
+// name = "chemical slug"
+
+//* Magazine *//
+
+/obj/item/ammo_magazine/nt_protomag
+ desc = "A magazine for a magnetic weapon of some kind."
+ ammo_caliber = /datum/caliber/nt_protomag
+
+#warn first two should fit in webbing, but not boxes
+
+/obj/item/ammo_magazine/nt_protomag/sidearm
+ name = "protomag sidearm magazine"
+ ammo_max = 8
+
+ w_class = WEIGHT_CLASS_NORMAL // no boxes
+ weight_volume = WEIGHT_VOLUME_TINY
+ slot_flags = SLOT_POCKET
+
+/obj/item/ammo_magazine/nt_protomag/rifle
+ name = "protomag rifle magazine"
+ ammo_max = 16
+
+ w_class = WEIGHT_CLASS_NORMAL // no boxes
+ weight_volume = WEIGHT_VOLUME_SMALL
+ slot_flags = SLOT_POCKET
+
+/obj/item/ammo_magazine/nt_protomag/box
+ name = "protomag ammo box"
+ desc = "A box of experimental magnetic ammunition."
+ ammo_max = 32
+
+ w_class = WEIGHT_CLASS_NORMAL // no boxes
+ weight_volume = WEIGHT_VOLUME_NORMAL
+ slot_flags = SLOT_POCKET
+
+#warn impl all
+
+#warn materials & R&D designs for all of the abvoe
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-caliber.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-caliber.dm
new file mode 100644
index 000000000000..75b43fadced0
--- /dev/null
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-caliber.dm
@@ -0,0 +1,9 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+// todo: proper diameter/length def
+/datum/ammo_caliber/nt_protomag
+ caliber = "nt-protomag"
+
+/datum/ammo_caliber/nt_protomag/antimaterial
+ caliber = "nt-protomag-antimaterial"
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
index e314cac78568..bc0e894b2daf 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
@@ -1,11 +1,12 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/**
* Modular mag-boosted weapons, courtesy of the Nanotrasen Research Division.
*/
/obj/item/gun/ballistic/magnetic/modular/nt_protomag
abstract_type = /obj/item/gun/ballistic/magnetic/modular/nt_protomag
+ desc = "A modular ferromagnetic-boosted weapon. Uses experimental ferromagnetic ammunition."
description_fluff = {"
An experimental magnetic weapon from the Nanotrasen Research Division. The 'protomag' series uses specially
made ammunition capable of a hybrid launch, combining conventional propellant with an accelerating burst
@@ -23,7 +24,6 @@
/obj/item/gun/ballistic/magnetic/modular/nt_protomag/sidearm
name = "protomag sidearm"
- desc = "A modular ferromagnetic-boosted weapon. Uses experimental ferromagnetic ammunition."
//* Rifle *//
@@ -31,266 +31,3 @@
/obj/item/gun/ballistic/magnetic/modular/nt_protomag/rifle
name = "protomag rifle"
- desc = "A modular ferromagnetic-boosted weapon. Uses experimental ferromagnetic ammunition"
-
-//* Caliber *//
-
-// todo: proper diameter/length def
-/datum/ammo_caliber/nt_protomag
- caliber = "nt-protomag"
-
-//* -- Ammo & Projectiles -- *//
-
-//* Base *//
-
-/obj/item/ammo_casing/nt_protomag
- name = "protomag casing"
- desc = "An obnoxiously long casing for some kind of rifle."
- caliber = /datum/ammo_caliber/nt_protomag
-
-/obj/projectile/bullet/nt_protomag
- #warn impl all
-
-#warn impl all, with boxes, and colors. how?
-
-//* Hybrid Rounds *//
-
-/obj/item/ammo_casing/nt_protomag/magboosted
- name = "protomag round"
- desc = "A slender bullet. It seems to have less propellant than usual."
- casing_primer = CASING_PRIMER_MAGNETIC | CASING_PRIMER_CHEMICAL
-
-// Normal
-
-/obj/item/ammo_casing/nt_protomag/magboosted/standard
- projectile_type = /obj/projectile/nt_protomag/standard
-
-/obj/item/ammo_magazine/nt_protomag/box/standard
- name = "protomag ammo box (standard)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/standard
-
-/obj/projectile/nt_protomag/standard
-
-// Armor Piercing
-
-/obj/item/ammo_casing/nt_protomag/magboosted/sabot
- name = "protomag round (sabot)"
- desc = "A slender bullet. While lacking in stopping power, this round is designed to punch through thicker than usual armor."
-
- projectile_type = /obj/projectile/nt_protomag/sabot
-
-/obj/item/ammo_magazine/nt_protomag/box/sabot
- name = "protomag ammo box (sabot)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/sabot
-
-/obj/projectile/bullet/nt_protomag/sabot
- name = "magnetic slug"
-
-// Hollow Point
-
-// todo: this is currently disabled as medcode is not verbose enough for this to work
-// /obj/item/ammo_casing/nt_protomag/magboosted/shredder
-// name = "protomag round (shredder)"
-// desc = "A slender bullet. While lacking in penetration, this round is designed to shred soft targets with ease."
-//
-// projectile_type = /obj/projectile/nt_protomag/shredder
-
-// /obj/item/ammo_magazine/nt_protomag/box/shredder
-// name = "protomag ammo box (shredder)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/shredder
-
-// /obj/projectile/bullet/nt_protomag/shredder
-// name = "fragmenting slug"
-
-// 'Rubber'
-
-/obj/item/ammo_casing/nt_protomag/magboosted/impact
- name = "protomag round (impact)"
- desc = "A slender bullet. This round is the magnetic equivalent of a beanbag. That said, it would be a bad idea to detain someone with a railgun, beanbag or not."
-
- projectile_type = /obj/projectile/nt_protomag/impact
-
-/obj/item/ammo_magazine/nt_protomag/box/impact
- name = "protomag ammo box (impact)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/impact
-
-/obj/projectile/bullet/nt_protomag/impact
- name = "deforming slug"
-
-// Practice
-
-/obj/item/ammo_casing/nt_protomag/magboosted/practice
- name = "protomag round (practice)"
- desc = "A slender bullet. This round is just a practice round. While it is made out of relatively soft materials, you should still try to not get shot by this."
-
- projectile_type = /obj/projectile/nt_protomag/practice
-
-/obj/item/ammo_magazine/nt_protomag/box/practice
- name = "protomag ammo box (practice)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/practice
-
-/obj/projectile/bullet/nt_protomag/practice
- name = "lightweight slug"
-
-//* Magnetic Rounds *//
-
-/obj/item/ammo_casing/nt_protomag/magnetic
- name = "protomag slug"
- desc = "A slender ferromagnetic slug. A bullet without propellant, for whatever reason."
- casing_primer = CASING_PRIMER_MAGNETIC
-
-// Smoke
-
-/obj/item/ammo_casing/nt_protomag/magnetic/smoke
- name = "protomag slug (smoke)"
- desc = "A slender ferromagnetic slug. While lacking in penetration, this round releases a light smokescreen on impact."
-
- projectile_type = /obj/projectile/nt_protomag/smoke
-
-/obj/item/ammo_magazine/nt_protomag/box/smoke
- name = "protomag ammo box (smoke)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/smoke
-
-/obj/projectile/bullet/nt_protomag/smoke
- name = "disintegrating slug"
-
-// Ion
-
-/obj/item/ammo_casing/nt_protomag/magnetic/emp
- name = "protomag slug (emp)"
- desc = "A slender ferromagnetic slug. While lacking in penetration, this round releases a small electromagnetic burst on impact."
-
- projectile_type = /obj/projectile/nt_protomag/emp
-
-/obj/item/ammo_magazine/nt_protomag/box/emp
- name = "protomag ammo box (emp)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/emp
-
-/obj/projectile/bullet/nt_protomag/emp
- name = "ion slug"
-
-// Concussive
-
-// todo: this is currently disabled as simplemobs are not complex-AI enough for us to do this, and we don't need a PVP-only tool
-// /obj/item/ammo_casing/nt_protomag/magnetic/concussive
-// name = "protomag slug (concussive)"
-// desc = "A slender ferromagnetic slug. While lacking in penetration, this round contains a small airburst charge that detonates on impact."
-
-// projectile_type = /obj/projectile/nt_protomag/concussive
-
-// /obj/item/ammo_magazine/nt_protomag/box/concussive
-// name = "protomag ammo box (concussive)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/concussive
-
-// /obj/projectile/bullet/nt_protomag/concussive
-// name = "concussive slug"
-
-// Piece
-
-/obj/item/ammo_casing/nt_protomag/magnetic/penetrator
- name = "protomag slug (penetrator)"
- desc = "A slender ferromagnetic slug. This one is made out of dense alloys, and is designed to punch through materials with ease. This round has very high recoil, as well as power draw."
-
- projectile_type = /obj/projectile/nt_protomag/penetrator
-
-/obj/item/ammo_magazine/nt_protomag/box/penetrator
- name = "protomag ammo box (penetrator)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/penetrator
-
-/obj/projectile/bullet/nt_protomag/penetrator
- name = "high-velocity slug"
-
-// 'Stun'
-
-/obj/item/ammo_casing/nt_protomag/magnetic/shock
- name = "protomag slug (shock)"
- desc = "A slender ferromagnetic slug. This one is designed to release a burst of energy on imapct for less-than-lethal takedowns. That said, it would probably still be a bad idea to detain someone with a railgun slug."
-
- projectile_type = /obj/projectile/nt_protomag/shock
-
-/obj/item/ammo_magazine/nt_protomag/box/shock
- name = "protomag ammo box (shock)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/shock
-
-/obj/projectile/bullet/nt_protomag/shock
- name = "piezo slug"
-
-// Light
-
-/obj/item/ammo_casing/nt_protomag/magnetic/flare
- name = "protomag slug (flare)"
- desc = "A slender ferromagnetic slug. Shatters into a lingering chemical illuminant on impact."
-
- projectile_type = /obj/projectile/nt_protomag/flare
-
-/obj/item/ammo_magazine/nt_protomag/box/flare
- name = "protomag ammo box (flare)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/flare
-
-/obj/projectile/bullet/nt_protomag/flare
- name = "tracer shot"
-
-// todo: fuck no, rework fire stacks / fire first, holy crap; even then this should take multiple hits to ignite.
-// /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
-// name = "protomag slug (incendiary)"
-// desc = "A slender ferromagnetic slug. With almost no penetrating power whatsoever, this round is designed to explode into an incendiary material on impact"
-
-// projectile_type = /obj/projectile/nt_protomag/incendiary
-
-// /obj/item/ammo_magazine/nt_protomag/box/incendiary
-// name = "protomag ammo box (incendiary)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
-
-// /obj/projectile/bullet/nt_protomag/incendiary
-// name = "incendiary slug"
-
-// todo: fuck no, not until chloral and chemicals are reworked; this round is meant to take like 2-3 units maximum, on that note.
-// /obj/item/ammo_casing/nt_protomag/magnetic/reagent
-// name = "protomag slug (chemical)"
-// desc = "A slender ferromagnetic slug. Can be laced with a small amount of reagents, which will then splash onto and be injected into a hit target."
-
-// projectile_type = /obj/projectile/nt_protomag/reagent
-
-// /obj/item/ammo_magazine/nt_protomag/box/reagent
-// name = "protomag ammo box (reagent)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/reagent
-
-// /obj/projectile/bullet/nt_protomag/reagent
-// name = "chemical slug"
-
-//* Magazine *//
-
-/obj/item/ammo_magazine/nt_protomag
- desc = "A magazine for a magnetic weapon of some kind."
- ammo_caliber = /datum/caliber/nt_protomag
-
-#warn first two should fit in webbing, but not boxes
-
-/obj/item/ammo_magazine/nt_protomag/sidearm
- name = "protomag sidearm magazine"
- ammo_max = 8
-
- w_class = WEIGHT_CLASS_NORMAL // no boxes
- weight_volume = WEIGHT_VOLUME_TINY
- slot_flags = SLOT_POCKET
-
-/obj/item/ammo_magazine/nt_protomag/rifle
- name = "protomag rifle magazine"
- ammo_max = 16
-
- w_class = WEIGHT_CLASS_NORMAL // no boxes
- weight_volume = WEIGHT_VOLUME_SMALL
- slot_flags = SLOT_POCKET
-
-/obj/item/ammo_magazine/nt_protomag/box
- name = "protomag ammo box"
- desc = "A box of experimental magnetic ammunition."
- ammo_max = 32
-
- w_class = WEIGHT_CLASS_NORMAL // no boxes
- weight_volume = WEIGHT_VOLUME_NORMAL
- slot_flags = SLOT_POCKET
-
-#warn impl all
-
-#warn materials & R&D designs for all of the abvoe
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 67a53180e428..1860cae99054 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -337,54 +337,6 @@
cell_type = /obj/item/cell/high
charge_cost = 2500
-#warn rework this and have a radial preview mode for firemodes
-/obj/item/gun/energy/service
- name = "service weapon"
- icon_state = "service_grip"
- item_state = "service_grip"
- desc = "An anomalous weapon, long kept secure. It has recently been acquired by Nanotrasen's Paracausal Monitoring Division. How did it get here?"
- damage_force = 5
- slot_flags = SLOT_BELT
- w_class = WEIGHT_CLASS_NORMAL
- projectile_type = /obj/projectile/bullet/pistol/medium/silver
- origin_tech = null
- fire_delay = 10 //Old pistol
- charge_cost = 480 //to compensate a bit for self-recharging
- cell_type = /obj/item/cell/device/weapon/recharge/captain
- legacy_battery_lock = 1
- one_handed_penalty = 0
- safety_state = GUN_SAFETY_OFF
-
-/obj/item/gun/energy/service/grip
-
-/obj/item/gun/energy/service/shatter
- name = "service weapon (shatter)"
- icon_state = "service_shatter"
- projectile_type = /obj/projectile/bullet/pellet/shotgun/silvershot
- fire_delay = 15 //Increased by 50% for strength.
- charge_cost = 600 //Charge increased due to shotgun round.
-
-/obj/item/gun/energy/service/spin
- name = "service weapon (spin)"
- icon_state = "service_spin"
- projectile_type = /obj/projectile/bullet/pistol/spin
- fire_delay = 0 //High fire rate.
- charge_cost = 80 //Lower cost per shot to encourage rapid fire.
-
-/obj/item/gun/energy/service/pierce
- name = "service weapon (pierce)"
- icon_state = "service_pierce"
- projectile_type = /obj/projectile/bullet/rifle/a762/ap/silver
- fire_delay = 15 //Increased by 50% for strength.
- charge_cost = 600 //Charge increased due to sniper round.
-
-/obj/item/gun/energy/service/charge
- name = "service weapon (charge)"
- icon_state = "service_charge"
- projectile_type = /obj/projectile/bullet/burstbullet/service //Formerly: obj/projectile/bullet/gyro. A little too robust.
- fire_delay = 20
- charge_cost = 800 //Three shots.
-
/obj/item/gun/energy/puzzle_key
name = "Key of Anak-Hun-Tamuun"
desc = "An arcane stave that fires a powerful energy blast. Why was this just left laying around here?"
diff --git a/code/modules/projectiles/guns/firemode.dm b/code/modules/projectiles/guns/firemode.dm
index f5757a4fef0d..b33ac7b7229a 100644
--- a/code/modules/projectiles/guns/firemode.dm
+++ b/code/modules/projectiles/guns/firemode.dm
@@ -20,6 +20,14 @@
var/render_color
#warn impl
+ //* UI *//
+ /// appearance used for radial
+ ///
+ /// supported values:
+ /// * /image
+ /// * /mutable_appearance
+ var/radial_appearance
+
//* LEGACY *//
/// direct vv edits to the gun applied when we're selected.
///
diff --git a/code/modules/projectiles/guns/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
index 976e591a737e..5ecf3a6b6a62 100644
--- a/code/modules/projectiles/guns/gun-firing.dm
+++ b/code/modules/projectiles/guns/gun-firing.dm
@@ -113,26 +113,38 @@
our_cycle.cycle_start_time = world.time
// begin
firing_cycle = our_cycle
+ // send start hooks
on_firing_cycle_start(our_cycle)
+ SEND_SIGNAL(src, COMSIG_GUN_FIRING_CYCLE_START, our_cycle)
var/safety = 50
var/iteration = 0
while(iteration < our_cycle.firing_iterations)
- ++iteration
- our_cycle.cycle_iterations_fired = iteration
+ // loop guard
--safety
if(safety <= 0)
CRASH("safety ran out during firing cycle")
+ // increment iteration; track it locally too, just in case
+ ++iteration
+ our_cycle.cycle_iterations_fired = iteration
+ // fire signal
+ SEND_SIGNAL(src, COMSIG_GUN_FIRING_CYCLE_ITERATION_PREFIRE, our_cycle)
+ // fire
our_cycle.last_firing_result = fire(our_cycle)
+ // post-fire
if(!post_fire(our_cycle))
break
+ // continue if needed
if(iteration != our_cycle.firing_iterations)
sleep(our_cycle.firing_delay)
if(firing_cycle != our_cycle)
our_cycle.last_interrupted = TRUE
break
+ // send end hooks
on_firing_cycle_end(our_cycle)
+ SEND_SIGNAL(src, COMSIG_GUN_FIRING_CYCLE_END, our_cycle)
+
return our_cycle
//* Firing *//
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index 9b5f219c6eba..e02bd8d52af2 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -79,6 +79,9 @@
* This variable may either be a list, of the above, or a singular of the above.
*/
var/list/firemodes = /datum/firemode
+ /// use radial for firemode
+ var/firemodes_use_radial = FALSE
+ #warn impl
//* Firing *//
From ba7654271292d15edea40aa36b9cc8f1ed6fad32 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Thu, 7 Nov 2024 20:48:18 -0500
Subject: [PATCH 57/68] reference implementation
---
code/__DEFINES/projectiles/gun_components.dm | 11 +++++-
.../modules/projectiles/guns/gun_component.dm | 16 ++++++++-
.../guns/gun_component/internal_module.dm | 36 +++++++++++++++++++
.../projectiles/guns/gun_firing_cycle.dm | 2 ++
4 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/code/__DEFINES/projectiles/gun_components.dm b/code/__DEFINES/projectiles/gun_components.dm
index 9730333f5ec3..fdf1dcc8788e 100644
--- a/code/__DEFINES/projectiles/gun_components.dm
+++ b/code/__DEFINES/projectiles/gun_components.dm
@@ -1,7 +1,7 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//
-//* Slots - /obj/item/gun_component *//
+//**** Slots - /obj/item/gun_component ****//
//* Note: These are all suggestions. *//
//* Components hook the gun via component signals and registration APIs *//
@@ -53,3 +53,12 @@ GLOBAL_REAL_LIST(gun_component_enum_to_name) = list(
GUN_COMPONENT_FOCUSING_LENS = "focusing lens",
GUN_COMPONENT_PARTICLE_ARRAY = "particle array",
)
+
+//**** Conflict Flags - /obj/item/gun_component ****//
+
+/**
+ * Burst modifiers.
+ */
+#define GUN_COMPONENT_CONFLICT_BURST_MODIFICATION (1<<0)
+
+#warn flesh this out
diff --git a/code/modules/projectiles/guns/gun_component.dm b/code/modules/projectiles/guns/gun_component.dm
index f16fdc734e08..6ff3e394c3fc 100644
--- a/code/modules/projectiles/guns/gun_component.dm
+++ b/code/modules/projectiles/guns/gun_component.dm
@@ -17,8 +17,15 @@
/// * This is just a suggestion.
/// * The actual APIs used are agnostic of this value.
var/component_slot
+ /// Conflict flags
+ var/component_conflict = NONE
+ #warn impl
+
/// should we be hidden from examine?
var/show_on_examine = TRUE
+ /// automatically hook firing iteration pre-fire? will call on_firing_cycle_iteration(cycle) if hooked.
+ var/hook_iteration_pre_fire = FALSE
+ #warn impl
/// currently attached gun
var/obj/item/gun/attached
@@ -53,6 +60,14 @@
/obj/item/gun_component/proc/on_detach(obj/item/gun/gun, datum/event_args/actor/actor, silent)
SHOULD_CALL_PARENT(TRUE)
+//* Gun API *//
+
+/**
+ * Called right before fire() is invoked, if [hook_iteration_pre_fire] is set.
+ */
+/obj/item/gun_component/proc/on_firing_cycle_iteration(datum/gun_firing_cycle/cycle)
+ return
+
//* Information *//
/**
@@ -62,4 +77,3 @@
*/
/obj/item/gun_component/proc/summarize_bullet_points(datum/event_args/actor/actor)
return list()
-
diff --git a/code/modules/projectiles/guns/gun_component/internal_module.dm b/code/modules/projectiles/guns/gun_component/internal_module.dm
index 4f6aaed4eb70..8ecd138f03a1 100644
--- a/code/modules/projectiles/guns/gun_component/internal_module.dm
+++ b/code/modules/projectiles/guns/gun_component/internal_module.dm
@@ -3,8 +3,44 @@
/obj/item/gun_component/internal_module
name = "weapon module"
+ desc = "An internal module for a modular gun."
component_slot = GUN_COMPONENT_INTERNAL_MODULE
#warn impl all
// TODO: This file is mostly stubs and WIPs.
+
+/**
+ * mostly a test module;
+ *
+ * * makes the gun fire a second round on every fire
+ * * conflicts with any other burst modifiers
+ */
+/obj/item/gun_component/internal_module/double_shot
+ name = "AN-94 Fire Controller"
+ desc = /obj/item/gun_component/internal_module::desc + " This will cause the gun to fire one additional round per burst, at the cost of reduced accuracy."
+ component_conflict = GUN_COMPONENT_CONFLICT_BURST_MODIFICATION
+
+ /// angular dispersion to impose on the last round in the burst, and the round we add
+ var/dispersion_amount = 5
+
+/obj/item/gun_component/internal_module/double_shot/on_firing_cycle_iteration(datum/gun_firing_cycle/cycle)
+ // only invoke on last iteration
+ if(cycle.cycle_iterations_fired != cycle.firing_iterations)
+ return
+ // do not invoke multiple times
+ switch(LAZYACCESS(cycle.blackboard, "an-94-refire-triggered"))
+ if(1)
+ // add dispersion
+ LAZYSET(cycle.blackboard, "an-94-refire-triggered", 2)
+ cycle.next_dispersion += dispersion_amount
+ return
+ if(2)
+ // we're done here
+ return
+ // set re-invoke flag
+ LAZYSET(cycle.blackboard, "an-94-refire-triggered", 1)
+ // add one iteration
+ cycle.firing_iterations++
+ // force current shot dispersion
+ cycle.next_dispersion += dispersion_amount
diff --git a/code/modules/projectiles/guns/gun_firing_cycle.dm b/code/modules/projectiles/guns/gun_firing_cycle.dm
index a6d729d60519..c809a1b3d3fc 100644
--- a/code/modules/projectiles/guns/gun_firing_cycle.dm
+++ b/code/modules/projectiles/guns/gun_firing_cycle.dm
@@ -51,3 +51,5 @@
//* firing modifier args *//
//* this is where things like modular gun components will inject into. *//
+ /// blackboard for modular gun components to use
+ var/list/blackboard
From d89c4fdd5415222614385cb40a95cb42ab0fce42 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 8 Nov 2024 09:49:39 -0500
Subject: [PATCH 58/68] updates
---
.../projectiles/guns/energy/nuclear.dm | 65 +++++++++++++++----
.../projectiles/guns/energy/special.dm | 8 ++-
2 files changed, 56 insertions(+), 17 deletions(-)
diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm
index 9b43566e3a94..24b03a444d7f 100644
--- a/code/modules/projectiles/guns/energy/nuclear.dm
+++ b/code/modules/projectiles/guns/energy/nuclear.dm
@@ -1,3 +1,17 @@
+/datum/firemode/energy/energy_gun
+ abstract_type = /datum/firemode/energy/energy_gun
+ cycle_cooldown = 1 SECONDS
+
+/datum/firemode/energy/energy_gun/stun
+ name = "stun"
+ projectile_type = /obj/projectile/beam/stun/med
+ charge_cost = 2400 / 10
+
+/datum/firemode/energy/energy_gun/kill
+ name = "lethal"
+ projectile_type = /obj/projectile/beam
+ charge_cost = 2400 / 5
+
/obj/item/gun/energy/gun
name = "energy gun"
desc = "Another bestseller of Lawson Arms and "+TSC_HEPH+", the LAEP90 Perun is a versatile energy based sidearm, capable of switching between low and high capacity projectile settings. In other words: Stun or Kill."
@@ -8,14 +22,12 @@
item_state = null //so the human update icon uses the icon_state instead.
worth_intrinsic = 250
-
- projectile_type = /obj/projectile/beam/stun/med
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2)
modifystate = "energystun"
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/med, modifystate="energystun", charge_cost = 240, fire_delay = 1 SECONDS),
- list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="energykill", charge_cost = 300, fire_delay = 1 SECONDS),
+ /datum/firemode/energy/energy_gun/stun,
+ /datum/firemode/energy/energy_gun/kill,
)
/obj/item/gun/energy/gun/mounted
@@ -24,6 +36,7 @@
use_external_power = 1
/datum/firemode/energy/burst_laser
+ abstract_type = /datum/firemode/energy/burst_laser
burst_delay = 0.2 SECONDS
cycle_cooldown = 0.6 SECONDS
@@ -109,6 +122,20 @@
/datum/firemode/energy/mining_carbine/scatter_burst,
)
+/datum/firemode/energy/advanced_energy_gun
+ abstract_type = /datum/firemode/energy/advanced_energy_gun
+ cycle_cooldown = 0.6 SECONDS
+
+/datum/firemode/energy/advanced_energy_gun/stun
+ name = "stun"
+ projectile_type = /obj/projectile/beam/stun/med
+ charge_cost = 2400 / 10
+
+/datum/firemode/energy/advanced_energy_gun/kill
+ name = "lethal"
+ projectile_type = /obj/projectile/beam
+ charge_cost = 2400 / 5
+
/obj/item/gun/energy/gun/nuclear
name = "advanced energy gun"
desc = "An energy gun with an experimental miniaturized reactor."
@@ -119,7 +146,6 @@
damage_force = 8 //looks heavier than a pistol
w_class = WEIGHT_CLASS_BULKY //Looks bigger than a pistol, too.
heavy = TRUE
- fire_delay = 6 //This one's not a handgun, it should have the same fire delay as everything else
cell_type = /obj/item/cell/device/weapon/recharge
legacy_battery_lock = 1
modifystate = null
@@ -128,21 +154,32 @@
one_handed_penalty = 30 // It's rather bulky at the fore, so holding it in one hand is harder than with two.
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/beam/stun, modifystate="nucgunstun", charge_cost = 240), //10 shots
- list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="nucgunkill", charge_cost = 240), //10 shots
- )
+ /datum/firemode/energy/advanced_energy_gun/stun,
+ /datum/firemode/energy/advanced_energy_gun/kill,
+ )
+
+/datum/firemode/energy/legacy_nt_combat_pistol
+ abstract_type = /datum/firemode/energy/advanced_energy_gun
+ cycle_cooldown = 0.6 SECONDS
+
+/datum/firemode/energy/legacy_nt_combat_pistol/stun
+ name = "stun"
+ projectile_type = /obj/projectile/beam/stun/med
+ charge_cost = 2400 / 12
+
+/datum/firemode/energy/legacy_nt_combat_pistol/kill
+ name = "lethal"
+ projectile_type = /obj/projectile/beam
+ charge_cost = 2400 / 6
//NT SpecOps Laser Pistol
/obj/item/gun/energy/gun/combat
name = "NT-ES-2 energy pistol"
desc = "A purpose-built energy weapon designed to function as a sidearm for Nanotrasen special operations. This weapon is ideal for hazardous environments where both lethal and non-lethal responses may be required."
icon_state = "clpistolstun100"
- fire_delay = 8
-
- origin_tech = list(TECH_COMBAT = 5, TECH_MAGNET = 2)
modifystate = "clpistolstun"
firemodes = list(
- list(mode_name="stun", projectile_type=/obj/projectile/beam/stun/med, modifystate="clpistolstun", charge_cost = 200),
- list(mode_name="lethal", projectile_type=/obj/projectile/beam, modifystate="clpistolkill", charge_cost = 400),
- )
+ /datum/firemode/energy/legacy_nt_combat_pistol/stun,
+ /datum/firemode/energy/legacy_nt_combat_pistol/kill,
+ )
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 1860cae99054..e1c1178b6cae 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -346,9 +346,11 @@
item_state = "staffofchaos"
damage_force = 5
charge_meter = 0
- projectile_type = /obj/projectile/beam/emitter
- fire_delay = 10
- charge_cost = 800
+ firemodes = /datum/firemode/energy{
+ projectile_type = /obj/projectile/beam/emitter;
+ cycle_cooldown = 1 SECONDS;
+ charge_cost = 2400 / 3;
+ }
cell_type = /obj/item/cell/device/weapon/recharge/captain
legacy_battery_lock = 1
one_handed_penalty = 0
From 3a1dd4f6989bd7b77f34ffcbe5453ee8faa84482 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 8 Nov 2024 09:53:47 -0500
Subject: [PATCH 59/68] update
---
.../nanotrasen/items/guns/nt_pmd.dm | 20 ++++++++++++++-----
code/modules/projectiles/guns/firemode.dm | 8 ++++++++
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm
index 3d2147344917..08a9da177026 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_pmd.dm
@@ -12,35 +12,45 @@
name = "normal"
projectile_type = /obj/projectile/bullet/pistol/medium/silver
charge_cost = 2400 / 8
- radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-normal")
+
+/datum/firemode/energy/nt_pmd/service_revolver/normal/make_radial_appearance()
+ return image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-normal")
/datum/firemode/energy/nt_pmd/service_revolver/shatter
name = "shatter"
projectile_type = /obj/projectile/bullet/pellet/shotgun/silvershot
cycle_cooldown = 1.5 SECONDS
charge_cost = 2400 / 5
- radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-shatter")
+
+/datum/firemode/energy/nt_pmd/service_revolver/shatter/make_radial_appearance()
+ return image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-shatter")
/datum/firemode/energy/nt_pmd/service_revolver/spin
name = "spin"
projectile_type = /obj/projectile/bullet/pistol/spin
cycle_cooldown = 0.1 SECONDS
charge_cost = 2400 / 80
- radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-spin")
+
+/datum/firemode/energy/nt_pmd/service_revolver/spin/make_radial_appearance()
+ return image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-spin")
/datum/firemode/energy/nt_pmd/service_revolver/pierce
name = "pierce"
projectile_type = /obj/projectile/bullet/rifle/a762/ap/silver
cycle_cooldown = 1.5 SECONDS
charge_cost = 2400 / 5
- radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-pierce")
+
+/datum/firemode/energy/nt_pmd/service_revolver/pierce/make_radial_appearance()
+ return image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-pierce")
/datum/firemode/energy/nt_pmd/service_revolver/charge
name = "charge"
projectile_type = /obj/projectile/bullet/burstbullet/service
cycle_cooldown = 2 SECONDS
charge_cost = 2400 / 4
- radial_appearance = image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-charge")
+
+/datum/firemode/energy/nt_pmd/service_revolver/charge/make_radial_appearance()
+ return image(/obj/item/gun/energy/nt_pmd/service_revolver::icon, "service-charge")
/obj/item/gun/energy/nt_pmd/service_revolver
name = "service weapon"
diff --git a/code/modules/projectiles/guns/firemode.dm b/code/modules/projectiles/guns/firemode.dm
index b33ac7b7229a..a3f717e2744a 100644
--- a/code/modules/projectiles/guns/firemode.dm
+++ b/code/modules/projectiles/guns/firemode.dm
@@ -26,6 +26,8 @@
/// supported values:
/// * /image
/// * /mutable_appearance
+ ///
+ /// this must be created in [make_radial_appearance()] as this cannot be set to image() or similar at compile time
var/radial_appearance
//* LEGACY *//
@@ -71,3 +73,9 @@
/datum/firemode/proc/apply_legacy_variables(obj/item/gun/gun)
for(var/varname in legacy_direct_varedits)
gun.vars[varname] = legacy_direct_varedits[varname]
+
+/datum/firemode/proc/fetch_radial_appearance()
+ return radial_appearance || (radial_appearance = make_radial_appearance())
+
+/datum/firemode/proc/make_radial_appearance()
+ return
From ec5bef882892eb84c8fb21dd58be3e2b870e6ed2 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 8 Nov 2024 16:35:54 +0000
Subject: [PATCH 60/68] update
---
code/__HELPERS/game.dm | 17 ------
.../nanotrasen/items/guns/nt_isd.dm | 52 ++++++++++++++++---
.../nanotrasen/items/guns/nt_protomag.dm | 2 +-
.../projectiles/guns/ballistic/musket.dm | 4 +-
.../projectiles/guns/energy-firemode.dm | 2 +-
.../guns/energy/modular/modulargun.dm | 9 +++-
.../projectiles/guns/energy/special.dm | 8 +--
.../projectiles/guns/launcher/crossbow.dm | 4 +-
.../projectiles/guns/launcher/pneumatic.dm | 4 +-
.../guns/legacy_vr_guns/custom_guns.dm | 1 -
10 files changed, 69 insertions(+), 34 deletions(-)
diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index 4e9ca9fe3625..171e1fde9924 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -426,23 +426,6 @@
src.dest_x = dest_x
src.dest_y = dest_y
-/proc/projectile_trajectory(src_x, src_y, rotation, angle, power)
-
- // returns the destination (Vx,y) that a projectile shot at [src_x], [src_y], with an angle of [angle],
- // rotated at [rotation] and with the power of [power]
- // Thanks to VistaPOWA for this function
-
- var/power_x = power * cos(angle)
- var/power_y = power * sin(angle)
- var/time = 2* power_y / 10 //10 = g
-
- var/distance = time * power_x
-
- var/dest_x = src_x + distance*sin(rotation);
- var/dest_y = src_y + distance*cos(rotation);
-
- return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)
-
/**
* Gets the highest and lowest pressures from the tiles in cardinal directions
* around us, then checks the difference.
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
index 886cfab38589..8d47c9b9b6d6 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_isd.dm
@@ -50,7 +50,16 @@
/obj/item/gun/energy/nt_isd/sidearm
name = "hybrid taser"
desc = "A versatile energy sidearm used by corporate security."
- description_fluff = {""}
+ description_fluff = {"
+ A sidearm designed and manufactured by the Nanotrasen Research Division for its internal
+ security needs. Specialized in non-lethal takedowns of high-risk perpetrators, the ENP-17
+ is reminiscent of older electro-neural disruption devices used by less advanced societies in
+ how it operates.
+
+ After an increase in the presence of non-humanoid threats against Nanotrasen's operations in the
+ Frontier, this standard sidearm received an upgrade adding a more powerful focusing lens used for
+ a lethal setting that can be used in emergencies.
+ "}
firemodes = list(
/datum/firemode/energy/nt_isd/sidearm/stun,
/datum/firemode/energy/nt_isd/sidearm/disable,
@@ -84,8 +93,18 @@
/obj/item/gun/energy/nt_isd/carbine
name = "energy carbine"
- desc = "A versatile energy carbine used by corporate security."
- description_fluff = {""}
+ desc = "A versatile energy carbine often seen in the hands of frontier groups."
+ description_fluff = {"
+ A production model energy weapon developed in joint between the Nanotrasen Research Division
+ and Hephaestus Industries. Containing multiple focusing modes for its integrated particle
+ projector, the weapon has quickly proliferated to be a common sight on the Frontier.
+
+ An unfortunate consequence of this has been the equal proliferation of protective gear meant to
+ counteract this weapon's capabilities - with many threat-actors and even certain strains of lifeforms
+ developing augmented resistance to the weapon's stun settings - much to Nanotrasen's displeasure.
+ While Nanotrasen has many times attempted to replace this weapon's place in the staples of its
+ security divisions, all attempts to date have thus far failed.
+ "}
firemodes = list(
/datum/firemode/energy/nt_isd/carbine/disable,
/datum/firemode/energy/nt_isd/carbine/shock,
@@ -108,7 +127,16 @@
/obj/item/gun/energy/nt_isd/lance
name = "energy lance"
desc = "A particle rifle used by corporate security. Shoots focused particle beams."
- description_fluff = {""}
+ description_fluff = {"
+ Developed and used primarily by the Nanotrasen Research Division, the ENR-18 was
+ designed to be a specialized anti-armour weapon supplied to response teams and sparingly
+ stocked on installations operating in the most high-risk sectors.
+
+ Unfortunately, the march of modern technology and weaponry has forced the Research Division
+ to proliferate this weapon to many more of Nanotrasen's holdings due to the low, but
+ non-negligible risk of an incursion resistant to the standard Hephaestus weaponry used
+ at the time by Nanotrasen's internal security.
+ "}
firemodes = list(
/datum/firemode/energy/nt_isd/lance/kill,
)
@@ -141,7 +169,13 @@
/obj/item/gun/energy/nt_isd/multiphase
name = "multiphase sidearm"
desc = "A prototype sidearm for high-ranking corporate security."
- description_fluff = {""}
+ description_fluff = {"
+ A very expensive development of the Nanotrasen Research Division, the ENP-19 is
+ a durable sidearm manufactured for usage by the leaders of many internal security teams.
+ Containing a particle generation system closer to those used in Nanotrasen's secretive
+ pulse rifles than that of common Frontier energy eaponry, this weapon can be used in a variety
+ of scenarios.
+ "}
firemodes = list(
/datum/firemode/energy/nt_isd/multiphase/disable,
/datum/firemode/energy/nt_isd/multiphase/kill,
@@ -168,16 +202,22 @@
name = "phaser blast"
damage_force = 20
damage_tier = LASER_TIER_HIGH // ;)
+ // todo: remove
+ armor_penetration = 20
/obj/projectile/nt_isd/laser/multiphase
name = "focused laser"
damage_force = 40
damage_tier = LASER_TIER_HIGH
+ // todo: remove
+ armor_penetration = 37.5
/obj/projectile/nt_isd/laser/lance
name = "particle beam"
damage_force = 30
damage_tier = LASER_TIER_HIGH
+ // todo: remove
+ armor_penetration = 50
#warn sprites for above
@@ -195,7 +235,7 @@
// todo: this shouldn't be an emp, this should be like synthetik's
/obj/projectile/nt_isd/ion
- name = "ion bolt"
+ name = "ion beam"
base_projectile_effects = list(
/datum/projectile_effect/detonation/legacy_emp{
sev_2 = 1;
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
index bc0e894b2daf..debe6774a43f 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag.dm
@@ -8,7 +8,7 @@
abstract_type = /obj/item/gun/ballistic/magnetic/modular/nt_protomag
desc = "A modular ferromagnetic-boosted weapon. Uses experimental ferromagnetic ammunition."
description_fluff = {"
- An experimental magnetic weapon from the Nanotrasen Research Division. The 'protomag' series uses specially
+ An experimental magnetic weapon from the Nanotrasen Research Division. The 'Protomag' series uses specially
made ammunition capable of a hybrid launch, combining conventional propellant with an accelerating burst
from a set of acceleration coils to throw a slug down-range. While still lacking in ammo capacity,
this 'prototype' is already made in many Nanotrasen fleets for day-to-day usage. As of recent, designs
diff --git a/code/modules/projectiles/guns/ballistic/musket.dm b/code/modules/projectiles/guns/ballistic/musket.dm
index f4e148d2b964..e0a49a23d252 100644
--- a/code/modules/projectiles/guns/ballistic/musket.dm
+++ b/code/modules/projectiles/guns/ballistic/musket.dm
@@ -19,7 +19,9 @@
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2)
- fire_delay = 35
+ firemodes = /datum/firemode{
+ cycle_cooldown = 3.5 SECONDS;
+ }
fire_sound = 'sound/weapons/gunshot/musket.ogg'
recoil = 4
no_pin_required = 1
diff --git a/code/modules/projectiles/guns/energy-firemode.dm b/code/modules/projectiles/guns/energy-firemode.dm
index 7b79f3eeacc0..e405941b7f58 100644
--- a/code/modules/projectiles/guns/energy-firemode.dm
+++ b/code/modules/projectiles/guns/energy-firemode.dm
@@ -29,5 +29,5 @@
/datum/firemode/energy/clone(include_contents)
var/datum/firemode/energy/cloning = ..()
cloning.charge_cost = charge_cost
- cloning.projectile_type = projectile_trajectory
+ cloning.projectile_type = projectile_type
return cloning
diff --git a/code/modules/projectiles/guns/energy/modular/modulargun.dm b/code/modules/projectiles/guns/energy/modular/modulargun.dm
index 1447e773e8c4..20dba7bd9fd4 100644
--- a/code/modules/projectiles/guns/energy/modular/modulargun.dm
+++ b/code/modules/projectiles/guns/energy/modular/modulargun.dm
@@ -69,8 +69,13 @@
var/chargecost = primarycore.beamcost * lasercap.costmod //Cost for primary fire.
chargecost += lasercooler.costadd //Cooler adds a flat amount post capacitor based on firedelay mod. Can be negative.
var/scatter = laserlens.scatter //Does it scatter the beams?
- fire_delay = lasercap.firedelay * lasercooler.delaymod //Firedelay caculated by the capacitor and the laser cooler.
- burst_delay = circuit.burst_delay * lasercooler.delaymod //Ditto but with burst delay.
+ var/fire_delay = lasercap.firedelay * lasercooler.delaymod //Firedelay caculated by the capacitor and the laser cooler.
+ var/burst_delay = circuit.burst_delay * lasercooler.delaymod //Ditto but with burst delay.
+ // shitcode to make old code work; basically wait until the generate.
+ spawn(0)
+ for(var/datum/firemode/firemode in src.firemodes)
+ firemode.cycle_cooldown = fire_delay
+ firemode.burst_delay = burst_delay
accuracy = laserlens.accuracy
var/chargecost_lethal = 120
var/chargecost_special = 120
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index e1c1178b6cae..e9ee0a33725c 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -387,9 +387,11 @@
desc = "Deceptively primitive in appearance, this finely tuned rifle uses an onboard reactor to stimulate the growth of an anomalous crystal. Fragments of this crystal are utilized as ammunition by the weapon."
icon_state = "warplockgun"
item_state = "huntrifle"
- projectile_type = /obj/projectile/bullet/cyanideround/jezzail
- fire_delay = 20
- charge_cost = 600
+ firemodes = /datum/firemode/energy{
+ projectile_type = /obj/projectile/bullet/cyanideround/jezzail;
+ cycle_cooldown = 2 SECONDS;
+ charge_cost = 2400 / 4;
+ }
cell_type = /obj/item/cell/device/weapon
legacy_battery_lock = 1
slot_flags = SLOT_BACK
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index 497dfd6945c7..5f7077cd1815 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -55,7 +55,9 @@
item_state = "crossbow-solid"
fire_sound = 'sound/weapons/punchmiss.ogg' // TODO: Decent THWOK noise.
fire_sound_text = "a solid thunk"
- fire_delay = 25
+ firemodes = /datum/firemode{
+ cycle_cooldown = 2.5 SECONDS;
+ }
slot_flags = SLOT_BACK
safety_state = GUN_NO_SAFETY
one_handed_penalty = 10
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index e32c6c47b9f8..ada6f1319577 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -7,7 +7,9 @@
w_class = WEIGHT_CLASS_HUGE
heavy = TRUE
fire_sound_text = "a loud whoosh of moving air"
- fire_delay = 50
+ firemodes = /datum/firemode{
+ cycle_cooldown = 5 SECONDS;
+ }
fire_sound = 'sound/weapons/grenade_launcher.ogg' // Formerly tablehit1.ogg but I like this better -Ace
one_handed_penalty = 10
diff --git a/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm b/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
index 497a1fefac2f..2054dbb9651c 100644
--- a/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
+++ b/code/modules/projectiles/guns/legacy_vr_guns/custom_guns.dm
@@ -126,7 +126,6 @@
desc = "The finest sidearm produced by RauMauser. Although its battery cannot be removed, its ergonomic design makes it easy to shoot, allowing for rapid follow-up shots. It also has the ability to toggle between stun and kill."
icon_state = "elugerstun100"
item_state = "gun"
- fire_delay = null // Lugers are quite comfortable to shoot, thus allowing for more controlled follow-up shots. Rate of fire similar to a laser carbine.
legacy_battery_lock = 1 // In exchange for balance, you cannot remove the battery. Also there's no sprite for that and I fucking suck at sprites. -Ace
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2, TECH_ILLEGAL = 2)
modifystate = "elugerstun"
From e93ba6e4a28c63db32baf32c92cf38e76a2e0038 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 8 Nov 2024 16:44:38 +0000
Subject: [PATCH 61/68] split files
---
citadel.dme | 2 +
code/__DEFINES/projectiles/gun_components.dm | 2 +
.../nanotrasen/items/guns/nt_protomag-ammo.dm | 165 ------------------
.../items/guns/nt_protomag-magazine.dm | 101 +++++++++++
.../items/guns/nt_protomag-projectile.dm | 54 ++++++
5 files changed, 159 insertions(+), 165 deletions(-)
create mode 100644 code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm
create mode 100644 code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
diff --git a/citadel.dme b/citadel.dme
index 51435c609abf..b0dd8d6c35c9 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -1104,6 +1104,8 @@
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_pmd.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag-ammo.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag-caliber.dm"
+#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag-magazine.dm"
+#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag-projectile.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_protomag.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\nt_pulse.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\animals.dm"
diff --git a/code/__DEFINES/projectiles/gun_components.dm b/code/__DEFINES/projectiles/gun_components.dm
index fdf1dcc8788e..f09638c18efb 100644
--- a/code/__DEFINES/projectiles/gun_components.dm
+++ b/code/__DEFINES/projectiles/gun_components.dm
@@ -61,4 +61,6 @@ GLOBAL_REAL_LIST(gun_component_enum_to_name) = list(
*/
#define GUN_COMPONENT_CONFLICT_BURST_MODIFICATION (1<<0)
+// todo: DEFINE_ENUM
+
#warn flesh this out
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
index fe7c60c14dff..e4c5efb98ed0 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
@@ -1,55 +1,25 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//
-//* -- Ammo & Projectiles -- *//
-
-//* Base *//
-
/obj/item/ammo_casing/nt_protomag
name = "protomag casing"
desc = "An obnoxiously long casing for some kind of rifle."
caliber = /datum/ammo_caliber/nt_protomag
-/obj/projectile/bullet/nt_protomag
- #warn impl all
-
-#warn impl all, with boxes, and colors. how?
-
-//* Hybrid Rounds *//
-
/obj/item/ammo_casing/nt_protomag/magboosted
name = "protomag round"
desc = "A slender bullet. It seems to have less propellant than usual."
casing_primer = CASING_PRIMER_MAGNETIC | CASING_PRIMER_CHEMICAL
-// Normal
-
/obj/item/ammo_casing/nt_protomag/magboosted/standard
projectile_type = /obj/projectile/nt_protomag/standard
-/obj/item/ammo_magazine/nt_protomag/box/standard
- name = "protomag ammo box (standard)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/standard
-
-/obj/projectile/nt_protomag/standard
-
-// Armor Piercing
-
/obj/item/ammo_casing/nt_protomag/magboosted/sabot
name = "protomag round (sabot)"
desc = "A slender bullet. While lacking in stopping power, this round is designed to punch through thicker than usual armor."
projectile_type = /obj/projectile/nt_protomag/sabot
-/obj/item/ammo_magazine/nt_protomag/box/sabot
- name = "protomag ammo box (sabot)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/sabot
-
-/obj/projectile/bullet/nt_protomag/sabot
- name = "magnetic slug"
-
-// Hollow Point
-
// todo: this is currently disabled as medcode is not verbose enough for this to work
// /obj/item/ammo_casing/nt_protomag/magboosted/shredder
// name = "protomag round (shredder)"
@@ -57,87 +27,35 @@
//
// projectile_type = /obj/projectile/nt_protomag/shredder
-// /obj/item/ammo_magazine/nt_protomag/box/shredder
-// name = "protomag ammo box (shredder)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/shredder
-
-// /obj/projectile/bullet/nt_protomag/shredder
-// name = "fragmenting slug"
-
-// 'Rubber'
-
/obj/item/ammo_casing/nt_protomag/magboosted/impact
name = "protomag round (impact)"
desc = "A slender bullet. This round is the magnetic equivalent of a beanbag. That said, it would be a bad idea to detain someone with a railgun, beanbag or not."
projectile_type = /obj/projectile/nt_protomag/impact
-/obj/item/ammo_magazine/nt_protomag/box/impact
- name = "protomag ammo box (impact)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/impact
-
-/obj/projectile/bullet/nt_protomag/impact
- name = "deforming slug"
-
-// Practice
-
/obj/item/ammo_casing/nt_protomag/magboosted/practice
name = "protomag round (practice)"
desc = "A slender bullet. This round is just a practice round. While it is made out of relatively soft materials, you should still try to not get shot by this."
projectile_type = /obj/projectile/nt_protomag/practice
-/obj/item/ammo_magazine/nt_protomag/box/practice
- name = "protomag ammo box (practice)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/practice
-
-/obj/projectile/bullet/nt_protomag/practice
- name = "lightweight slug"
-
-//* Magnetic Rounds *//
-
/obj/item/ammo_casing/nt_protomag/magnetic
name = "protomag slug"
desc = "A slender ferromagnetic slug. A bullet without propellant, for whatever reason."
casing_primer = CASING_PRIMER_MAGNETIC
-// Smoke
-
/obj/item/ammo_casing/nt_protomag/magnetic/smoke
name = "protomag slug (smoke)"
desc = "A slender ferromagnetic slug. While lacking in penetration, this round releases a light smokescreen on impact."
projectile_type = /obj/projectile/nt_protomag/smoke
-/obj/item/ammo_magazine/nt_protomag/box/smoke
- name = "protomag ammo box (smoke)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/smoke
-
-/obj/projectile/bullet/nt_protomag/smoke
- name = "disintegrating slug"
-
-// Ion
-
/obj/item/ammo_casing/nt_protomag/magnetic/emp
name = "protomag slug (emp)"
desc = "A slender ferromagnetic slug. While lacking in penetration, this round releases a small electromagnetic burst on impact."
projectile_type = /obj/projectile/nt_protomag/emp
-/obj/item/ammo_magazine/nt_protomag/box/emp
- name = "protomag ammo box (emp)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/emp
-
-/obj/projectile/bullet/nt_protomag/emp
- name = "ion slug"
- base_projectile_effects = list(
- /datum/projectile_effect/detonation/legacy_emp{
- sev_3 = 2;
- }
- )
-
-// Concussive
-
// todo: this is currently disabled as simplemobs are not complex-AI enough for us to do this, and we don't need a PVP-only tool
// /obj/item/ammo_casing/nt_protomag/magnetic/concussive
// name = "protomag slug (concussive)"
@@ -145,58 +63,24 @@
// projectile_type = /obj/projectile/nt_protomag/concussive
-// /obj/item/ammo_magazine/nt_protomag/box/concussive
-// name = "protomag ammo box (concussive)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/concussive
-
-// /obj/projectile/bullet/nt_protomag/concussive
-// name = "concussive slug"
-
-// Pierce
-
/obj/item/ammo_casing/nt_protomag/magnetic/penetrator
name = "protomag slug (penetrator)"
desc = "A slender ferromagnetic slug. This one is made out of dense alloys, and is designed to punch through materials with ease. This round has very high recoil, as well as power draw."
projectile_type = /obj/projectile/nt_protomag/penetrator
-/obj/item/ammo_magazine/nt_protomag/box/penetrator
- name = "protomag ammo box (penetrator)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/penetrator
-
-/obj/projectile/bullet/nt_protomag/penetrator
- name = "high-velocity slug"
-
-// 'Stun'
-
/obj/item/ammo_casing/nt_protomag/magnetic/shock
name = "protomag slug (shock)"
desc = "A slender ferromagnetic slug. This one is designed to release a burst of energy on imapct for less-than-lethal takedowns. That said, it would probably still be a bad idea to detain someone with a railgun slug."
projectile_type = /obj/projectile/nt_protomag/shock
-/obj/item/ammo_magazine/nt_protomag/box/shock
- name = "protomag ammo box (shock)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/shock
-
-/obj/projectile/bullet/nt_protomag/shock
- name = "piezo slug"
-
-// Light
-
/obj/item/ammo_casing/nt_protomag/magnetic/flare
name = "protomag slug (flare)"
desc = "A slender ferromagnetic slug. Shatters into a lingering chemical illuminant on impact."
projectile_type = /obj/projectile/nt_protomag/flare
-/obj/item/ammo_magazine/nt_protomag/box/flare
- name = "protomag ammo box (flare)"
- ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/flare
-
-/obj/projectile/bullet/nt_protomag/flare
- name = "tracer shot"
-
// todo: fuck no, rework fire stacks / fire first, holy crap; even then this should take multiple hits to ignite.
// /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
// name = "protomag slug (incendiary)"
@@ -204,13 +88,6 @@
// projectile_type = /obj/projectile/nt_protomag/incendiary
-// /obj/item/ammo_magazine/nt_protomag/box/incendiary
-// name = "protomag ammo box (incendiary)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
-
-// /obj/projectile/bullet/nt_protomag/incendiary
-// name = "incendiary slug"
-
// todo: fuck no, not until chloral and chemicals are reworked; this round is meant to take like 2-3 units maximum, on that note.
// /obj/item/ammo_casing/nt_protomag/magnetic/reagent
// name = "protomag slug (chemical)"
@@ -218,46 +95,4 @@
// projectile_type = /obj/projectile/nt_protomag/reagent
-// /obj/item/ammo_magazine/nt_protomag/box/reagent
-// name = "protomag ammo box (reagent)"
-// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/reagent
-
-// /obj/projectile/bullet/nt_protomag/reagent
-// name = "chemical slug"
-
-//* Magazine *//
-
-/obj/item/ammo_magazine/nt_protomag
- desc = "A magazine for a magnetic weapon of some kind."
- ammo_caliber = /datum/caliber/nt_protomag
-
-#warn first two should fit in webbing, but not boxes
-
-/obj/item/ammo_magazine/nt_protomag/sidearm
- name = "protomag sidearm magazine"
- ammo_max = 8
-
- w_class = WEIGHT_CLASS_NORMAL // no boxes
- weight_volume = WEIGHT_VOLUME_TINY
- slot_flags = SLOT_POCKET
-
-/obj/item/ammo_magazine/nt_protomag/rifle
- name = "protomag rifle magazine"
- ammo_max = 16
-
- w_class = WEIGHT_CLASS_NORMAL // no boxes
- weight_volume = WEIGHT_VOLUME_SMALL
- slot_flags = SLOT_POCKET
-
-/obj/item/ammo_magazine/nt_protomag/box
- name = "protomag ammo box"
- desc = "A box of experimental magnetic ammunition."
- ammo_max = 32
-
- w_class = WEIGHT_CLASS_NORMAL // no boxes
- weight_volume = WEIGHT_VOLUME_NORMAL
- slot_flags = SLOT_POCKET
-
#warn impl all
-
-#warn materials & R&D designs for all of the abvoe
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm
new file mode 100644
index 000000000000..33197965de74
--- /dev/null
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm
@@ -0,0 +1,101 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+// todo: type-gen all of these.
+/obj/item/ammo_magazine/nt_protomag
+ abstract_type = /obj/item/ammo_magazine/nt_protomag
+ desc = "A magazine for a magnetic weapon of some kind."
+ ammo_caliber = /datum/caliber/nt_protomag
+
+#warn first two should fit in webbing, but not boxes
+
+//* Sidearm Magazines *//
+
+/obj/item/ammo_magazine/nt_protomag/sidearm
+ name = "protomag sidearm magazine"
+ ammo_max = 8
+
+ w_class = WEIGHT_CLASS_NORMAL // no boxes
+ weight_volume = WEIGHT_VOLUME_TINY
+ slot_flags = SLOT_POCKET
+
+//* Rifle Magazines *//
+
+/obj/item/ammo_magazine/nt_protomag/rifle
+ name = "protomag rifle magazine"
+ ammo_max = 16
+
+ w_class = WEIGHT_CLASS_NORMAL // no boxes
+ weight_volume = WEIGHT_VOLUME_SMALL
+ slot_flags = SLOT_POCKET
+
+//* Boxes *//
+
+/obj/item/ammo_magazine/nt_protomag/box
+ abstract_type = /obj/item/ammo_magazine/nt_protomag/box
+ name = "protomag ammo box"
+ desc = "A box of experimental magnetic ammunition."
+ ammo_max = 32
+
+ w_class = WEIGHT_CLASS_NORMAL // no boxes
+ weight_volume = WEIGHT_VOLUME_NORMAL
+ slot_flags = SLOT_POCKET
+
+/obj/item/ammo_magazine/nt_protomag/box/standard
+ name = "protomag ammo box (standard)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/standard
+
+/obj/item/ammo_magazine/nt_protomag/box/sabot
+ name = "protomag ammo box (sabot)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/sabot
+
+// todo: this is currently disabled as medcode is not verbose enough for this to work
+// /obj/item/ammo_magazine/nt_protomag/box/shredder
+// name = "protomag ammo box (shredder)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/shredder
+
+/obj/item/ammo_magazine/nt_protomag/box/impact
+ name = "protomag ammo box (impact)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/impact
+
+/obj/item/ammo_magazine/nt_protomag/box/practice
+ name = "protomag ammo box (practice)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magboosted/practice
+
+/obj/item/ammo_magazine/nt_protomag/box/smoke
+ name = "protomag ammo box (smoke)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/smoke
+
+/obj/item/ammo_magazine/nt_protomag/box/emp
+ name = "protomag ammo box (emp)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/emp
+
+// todo: this is currently disabled as simplemobs are not complex-AI enough for us to do this, and we don't need a PVP-only tool
+// /obj/item/ammo_magazine/nt_protomag/box/concussive
+// name = "protomag ammo box (concussive)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/concussive
+
+/obj/item/ammo_magazine/nt_protomag/box/penetrator
+ name = "protomag ammo box (penetrator)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/penetrator
+
+/obj/item/ammo_magazine/nt_protomag/box/shock
+ name = "protomag ammo box (shock)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/shock
+
+/obj/item/ammo_magazine/nt_protomag/box/flare
+ name = "protomag ammo box (flare)"
+ ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/flare
+
+// todo: fuck no, rework fire stacks / fire first, holy crap; even then this should take multiple hits to ignite.
+// /obj/item/ammo_magazine/nt_protomag/box/incendiary
+// name = "protomag ammo box (incendiary)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/incendiary
+
+// todo: fuck no, not until chloral and chemicals are reworked; this round is meant to take like 2-3 units maximum, on that note.
+// /obj/item/ammo_magazine/nt_protomag/box/reagent
+// name = "protomag ammo box (reagent)"
+// ammo_preload = /obj/item/ammo_casing/nt_protomag/magnetic/reagent
+
+#warn impl all
+#warn materials & R&D designs for all of the abvoe
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
new file mode 100644
index 000000000000..07cac93a2513
--- /dev/null
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
@@ -0,0 +1,54 @@
+//* This file is explicitly licensed under the MIT license. *//
+//* Copyright (c) 2024 Citadel Station Developers *//
+
+/obj/projectile/nt_protomag
+ abstract_type = /obj/projectile/nt_protomag
+
+/obj/projectile/nt_protomag/standard
+
+/obj/projectile/nt_protomag/sabot
+ name = "magnetic slug"
+
+// todo: this is currently disabled as medcode is not verbose enough for this to work
+// /obj/projectile/nt_protomag/shredder
+// name = "fragmenting slug"
+
+/obj/projectile/nt_protomag/impact
+ name = "deforming slug"
+
+/obj/projectile/nt_protomag/practice
+ name = "lightweight slug"
+
+/obj/projectile/nt_protomag/smoke
+ name = "disintegrating slug"
+
+/obj/projectile/nt_protomag/emp
+ name = "ion slug"
+ base_projectile_effects = list(
+ /datum/projectile_effect/detonation/legacy_emp{
+ sev_3 = 2;
+ }
+ )
+
+// todo: this is currently disabled as simplemobs are not complex-AI enough for us to do this, and we don't need a PVP-only tool
+// /obj/projectile/nt_protomag/concussive
+// name = "concussive slug"
+
+/obj/projectile/nt_protomag/penetrator
+ name = "high-velocity slug"
+
+/obj/projectile/nt_protomag/shock
+ name = "piezo slug"
+
+/obj/projectile/nt_protomag/flare
+ name = "tracer shot"
+
+// todo: fuck no, rework fire stacks / fire first, holy crap; even then this should take multiple hits to ignite.
+// /obj/projectile/nt_protomag/incendiary
+// name = "incendiary slug"
+
+// todo: fuck no, not until chloral and chemicals are reworked; this round is meant to take like 2-3 units maximum, on that note.
+// /obj/projectile/nt_protomag/reagent
+// name = "chemical slug"
+
+#warn impl all
From 6ae99f5a4cda8cba7fe787166a044d3e360fd693 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 8 Nov 2024 20:28:35 +0000
Subject: [PATCH 62/68] Add inhand signals
---
.../signals_item/signals_item-interaction.dm | 6 +++++-
code/game/objects/items-interaction.dm | 16 ++++++++++++----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/code/__DEFINES/dcs/signals/signals_item/signals_item-interaction.dm b/code/__DEFINES/dcs/signals/signals_item/signals_item-interaction.dm
index d750540cfca7..1759290107ec 100644
--- a/code/__DEFINES/dcs/signals/signals_item/signals_item-interaction.dm
+++ b/code/__DEFINES/dcs/signals/signals_item/signals_item-interaction.dm
@@ -1,11 +1,15 @@
//* This file is explicitly licensed under the MIT license. *//
-//* Copyright (c) 2024 silicons *//
+//* Copyright (c) 2024 Citadel Station Developers *//
/// From base of obj/item/attack_self(): (/datum/event_args/actor/actor)
#define COMSIG_ITEM_ACTIVATE_INHAND "item_activate_inhand"
+ #define RAISE_ITEM_ACTIVATE_INHAND_HANDLED (1<<0)
/// From base of obj/item/unique_action(): (/datum/event_args/actor/actor)
#define COMSIG_ITEM_UNIQUE_ACTION "item_unique_action"
+ #define RAISE_ITEM_UNIQUE_ACTION_HANDLED (1<<0)
/// From base of obj/item/defensive_toggle(): (/datum/event_args/actor/actor)
#define COMSIG_ITEM_DEFENSIVE_TOGGLE "item_defensive_toggle"
+ #define RAISE_ITEM_DEFENSIVE_TOGGLE_HANDLED (1<<0)
/// From base of obj/item/defensive_trigger(): (/datum/event_args/actor/actor)
#define COMSIG_ITEM_DEFENSIVE_TRIGGER "item_defensive_trigger"
+ #define RAISE_ITEM_DEFENSIVE_TRIGGER_HANDLED (1<<0)
diff --git a/code/game/objects/items-interaction.dm b/code/game/objects/items-interaction.dm
index 6a7ec7d7eec9..6cb90fe9a26f 100644
--- a/code/game/objects/items-interaction.dm
+++ b/code/game/objects/items-interaction.dm
@@ -185,7 +185,9 @@
/obj/item/proc/attack_self(mob/user, datum/event_args/actor/actor)
// todo: this should realistically be SHOULD_NOT_OVERRIDE but there's a massive number of overrides (some unnecessary), so this is for a later date
// SHOULD_NOT_OVERRIDE(TRUE) // may be re-evaluated later
- SEND_SIGNAL(src, COMSIG_ITEM_ACTIVATE_INHAND, actor)
+ var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ACTIVATE_INHAND, actor)
+ if(signal_return & RAISE_ITEM_ACTIVATE_INHAND_HANDLED)
+ return TRUE
if(on_attack_self(actor))
return TRUE
if(interaction_flags_item & INTERACT_ITEM_ATTACK_SELF)
@@ -232,7 +234,9 @@
SHOULD_NOT_OVERRIDE(TRUE) // may be re-evaluated later
if(ismob(actor))
actor = new /datum/event_args/actor(actor)
- SEND_SIGNAL(src, COMSIG_ITEM_UNIQUE_ACTION, actor)
+ var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_UNIQUE_ACTION, actor)
+ if(signal_return & RAISE_ITEM_UNIQUE_ACTION_HANDLED)
+ return TRUE
if(on_unique_action(actor))
return TRUE
@@ -258,7 +262,9 @@
SHOULD_NOT_OVERRIDE(TRUE) // may be re-evaluated later
if(ismob(actor))
actor = new /datum/event_args/actor(actor)
- SEND_SIGNAL(src, COMSIG_ITEM_DEFENSIVE_TOGGLE, actor)
+ var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_DEFENSIVE_TOGGLE, actor)
+ if(signal_return & RAISE_ITEM_DEFENSIVE_TOGGLE_HANDLED)
+ return TRUE
if(on_defensive_toggle(actor))
return TRUE
@@ -284,7 +290,9 @@
SHOULD_NOT_OVERRIDE(TRUE) // may be re-evaluated later
if(ismob(actor))
actor = new /datum/event_args/actor(actor)
- SEND_SIGNAL(src, COMSIG_ITEM_DEFENSIVE_TRIGGER, actor)
+ var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_DEFENSIVE_TRIGGER, actor)
+ if(signal_return & RAISE_ITEM_DEFENSIVE_TRIGGER_HANDLED)
+ return TRUE
if(on_defensive_trigger(actor))
return TRUE
From 281372a51dce47a59d0189a1570442a88a26e5db Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Fri, 8 Nov 2024 18:17:22 -0500
Subject: [PATCH 63/68] k
---
code/__DEFINES/projectiles/gun_components.dm | 4 ----
1 file changed, 4 deletions(-)
diff --git a/code/__DEFINES/projectiles/gun_components.dm b/code/__DEFINES/projectiles/gun_components.dm
index f09638c18efb..a5fe19a840f7 100644
--- a/code/__DEFINES/projectiles/gun_components.dm
+++ b/code/__DEFINES/projectiles/gun_components.dm
@@ -60,7 +60,3 @@ GLOBAL_REAL_LIST(gun_component_enum_to_name) = list(
* Burst modifiers.
*/
#define GUN_COMPONENT_CONFLICT_BURST_MODIFICATION (1<<0)
-
-// todo: DEFINE_ENUM
-
-#warn flesh this out
From f7206e2f5475f2bb770197a0a9c74167b4038e7d Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sat, 9 Nov 2024 18:23:15 -0500
Subject: [PATCH 64/68] todo
---
code/modules/projectiles/guns/gun_component/internal_module.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/modules/projectiles/guns/gun_component/internal_module.dm b/code/modules/projectiles/guns/gun_component/internal_module.dm
index 8ecd138f03a1..ffeba739694a 100644
--- a/code/modules/projectiles/guns/gun_component/internal_module.dm
+++ b/code/modules/projectiles/guns/gun_component/internal_module.dm
@@ -44,3 +44,5 @@
cycle.firing_iterations++
// force current shot dispersion
cycle.next_dispersion += dispersion_amount
+
+// todo: integrated electronics framework
From 59f6923326d8ac39f5a36ad0314cfaec10dfb169 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sat, 9 Nov 2024 19:50:57 -0500
Subject: [PATCH 65/68] Fix
---
.../guns/gun-projectile-implementation.dm | 12 ++++++++++
code/modules/projectiles/guns/gun.dm | 23 -------------------
.../projectiles/projectile/projectile.dm | 8 -------
3 files changed, 12 insertions(+), 31 deletions(-)
diff --git a/code/modules/projectiles/guns/gun-projectile-implementation.dm b/code/modules/projectiles/guns/gun-projectile-implementation.dm
index d9477f60b172..4c9a84ccb13a 100644
--- a/code/modules/projectiles/guns/gun-projectile-implementation.dm
+++ b/code/modules/projectiles/guns/gun-projectile-implementation.dm
@@ -39,6 +39,7 @@
// todo: Reachability(), not Adjacent().
if((cycle.firing_flags & GUN_FIRING_POINT_BLANK) && cycle.original_target && cycle.firing_atom.Adjacent(cycle.original_target))
process_point_blank(firing_projectile, cycle.firing_actor?.performer, cycle.original_target)
+ play_fire_sound(cycle.firing_actor?.performer, firing_projectile)
//! END
// record stuff
@@ -51,6 +52,17 @@
// todo: muzzle flash
+/**
+ * Called to actually fire a projectile.
+ */
+/obj/item/gun/proc/launch_projectile(datum/gun_firing_cycle/cycle, obj/projectile/launching)
+ //! LEGACY
+ // this is just stupid lol why are we transcluding name directly into autopsy reports??
+ launching.shot_from = src.name
+ // this shouldn't be a hard-set thing and should be attachment set
+ launching.silenced = src.silenced
+ //! END
+
/**
* Obtains the next projectile to fire.
*
diff --git a/code/modules/projectiles/guns/gun.dm b/code/modules/projectiles/guns/gun.dm
index e02bd8d52af2..e66f9bc340f1 100644
--- a/code/modules/projectiles/guns/gun.dm
+++ b/code/modules/projectiles/guns/gun.dm
@@ -597,29 +597,6 @@
if(!isnull(M.accuracy_dispersion))
P.dispersion = max(P.dispersion + M.accuracy_dispersion, 0)
-//does the actual launching of the projectile
-/obj/item/gun/proc/process_projectile(obj/projectile, mob/user, atom/target, var/target_zone, var/params=null)
- var/obj/projectile/P = projectile
- if(!istype(P))
- return FALSE //default behaviour only applies to true projectiles
-
- //shooting while in shock
- var/forcespread
- if(istype(user, /mob/living/carbon))
- var/mob/living/carbon/mob = user
- if(mob.shock_stage > 120)
- forcespread = rand(50, 50)
- else if(mob.shock_stage > 70)
- forcespread = rand(-25, 25)
- else if(IS_PRONE(mob))
- forcespread = rand(-15, 15)
- var/launched = !P.launch_from_gun(target, target_zone, user, params, null, forcespread, src)
-
- if(launched)
- play_fire_sound(user, P)
-
- return launched
-
/obj/item/gun/proc/play_fire_sound(var/mob/user, var/obj/projectile/P)
var/shot_sound = fire_sound
diff --git a/code/modules/projectiles/projectile/projectile.dm b/code/modules/projectiles/projectile/projectile.dm
index ee0fbf1634c8..ca8da8f3bce2 100644
--- a/code/modules/projectiles/projectile/projectile.dm
+++ b/code/modules/projectiles/projectile/projectile.dm
@@ -599,14 +599,6 @@
launch_projectile_common(target, target_zone, user, params, angle_override, forced_spread)
return fire(angle_override, direct_target)
-//called to launch a projectile from a gun
-/obj/projectile/proc/launch_from_gun(atom/target, target_zone, mob/user, params, angle_override, forced_spread, obj/item/gun/launcher)
-
- shot_from = launcher.name
- silenced = launcher.silenced
-
- return launch_projectile(target, target_zone, user, params, angle_override, forced_spread)
-
/obj/projectile/proc/launch_projectile_from_turf(atom/target, target_zone, mob/user, params, angle_override, forced_spread = 0)
var/direct_target
if(get_turf(target) == get_turf(src))
From 830e9bca4ab2989c635d53c4e6488e8978877617 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sun, 10 Nov 2024 14:27:09 -0500
Subject: [PATCH 66/68] that
---
code/modules/projectiles/guns/gun-firing.dm | 2 ++
.../guns/gun_component/internal_module.dm | 19 ++++++++-----------
.../projectiles/guns/gun_firing_cycle.dm | 6 ++++++
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/code/modules/projectiles/guns/gun-firing.dm b/code/modules/projectiles/guns/gun-firing.dm
index 5ecf3a6b6a62..d65554056749 100644
--- a/code/modules/projectiles/guns/gun-firing.dm
+++ b/code/modules/projectiles/guns/gun-firing.dm
@@ -134,6 +134,8 @@
// post-fire
if(!post_fire(our_cycle))
break
+ // reset variables
+ our_cycle.next_dispersion_adjust = our_cycle.next_angle_adjust = null
// continue if needed
if(iteration != our_cycle.firing_iterations)
sleep(our_cycle.firing_delay)
diff --git a/code/modules/projectiles/guns/gun_component/internal_module.dm b/code/modules/projectiles/guns/gun_component/internal_module.dm
index ffeba739694a..4dae7fdaa5f7 100644
--- a/code/modules/projectiles/guns/gun_component/internal_module.dm
+++ b/code/modules/projectiles/guns/gun_component/internal_module.dm
@@ -30,19 +30,16 @@
return
// do not invoke multiple times
switch(LAZYACCESS(cycle.blackboard, "an-94-refire-triggered"))
+ if(0, null)
+ // set re-invoke flag
+ LAZYSET(cycle.blackboard, "an-94-refire-triggered", 1)
+ // add one iteration
+ cycle.firing_iterations++
+ // force current shot dispersion
+ cycle.next_dispersion += dispersion_amount
if(1)
// add dispersion
LAZYSET(cycle.blackboard, "an-94-refire-triggered", 2)
- cycle.next_dispersion += dispersion_amount
- return
- if(2)
- // we're done here
- return
- // set re-invoke flag
- LAZYSET(cycle.blackboard, "an-94-refire-triggered", 1)
- // add one iteration
- cycle.firing_iterations++
- // force current shot dispersion
- cycle.next_dispersion += dispersion_amount
+ cycle.next_dispersion_adjust += dispersion_amount
// todo: integrated electronics framework
diff --git a/code/modules/projectiles/guns/gun_firing_cycle.dm b/code/modules/projectiles/guns/gun_firing_cycle.dm
index c809a1b3d3fc..62be391f914d 100644
--- a/code/modules/projectiles/guns/gun_firing_cycle.dm
+++ b/code/modules/projectiles/guns/gun_firing_cycle.dm
@@ -48,6 +48,12 @@
var/last_firing_result
/// were we interrupted?
var/last_interrupted = FALSE
+ /// on this iteration, have this much dispersion added
+ var/next_dispersion_adjust
+ #warn hook
+ /// on this iteration, force adjust the angle by this much (pos = cw, neg = ccw)
+ var/next_angle_adjust
+ #warn hook
//* firing modifier args *//
//* this is where things like modular gun components will inject into. *//
From d09abcd0eeea6b6fccf4fcf17516cb40d2e98cf2 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sun, 10 Nov 2024 17:31:18 -0500
Subject: [PATCH 67/68] that
---
citadel.dme | 4 ++--
.../nanotrasen/items/guns/nt_protomag-ammo.dm | 12 ++++++++++++
.../nanotrasen/items/guns/nt_protomag-magazine.dm | 2 +-
.../items/guns/nt_protomag-projectile.dm | 14 +++++++++++++-
code/game/rendering/plane_masters/plane_master.dm | 1 +
.../nanotrasen/items/guns/protomag/ammo.dmi | Bin 0 -> 307 bytes
.../nanotrasen/items/guns/protomag/magazines.dmi | Bin 0 -> 520 bytes
.../nanotrasen/items/guns/protomag/pistol.dmi | Bin 0 -> 581 bytes
.../nanotrasen/items/guns/protomag/projectile.dmi | Bin 0 -> 552 bytes
.../nanotrasen/items/guns/protomag/rifle.dmi | Bin 0 -> 606 bytes
10 files changed, 29 insertions(+), 4 deletions(-)
create mode 100644 icons/content/factions/corporations/nanotrasen/items/guns/protomag/ammo.dmi
create mode 100644 icons/content/factions/corporations/nanotrasen/items/guns/protomag/magazines.dmi
create mode 100644 icons/content/factions/corporations/nanotrasen/items/guns/protomag/pistol.dmi
create mode 100644 icons/content/factions/corporations/nanotrasen/items/guns/protomag/projectile.dmi
create mode 100644 icons/content/factions/corporations/nanotrasen/items/guns/protomag/rifle.dmi
diff --git a/citadel.dme b/citadel.dme
index b0dd8d6c35c9..c6dc92c38d8a 100644
--- a/citadel.dme
+++ b/citadel.dme
@@ -307,8 +307,8 @@
#include "code\__DEFINES\procs\update_icon.dm"
#include "code\__DEFINES\projectiles\ammo_casing.dm"
#include "code\__DEFINES\projectiles\ammo_magazine.dm"
-#include "code\__DEFINES\projectiles\gun_components.dm"
#include "code\__DEFINES\projectiles\gun.dm"
+#include "code\__DEFINES\projectiles\gun_components.dm"
#include "code\__DEFINES\projectiles\guns.dm"
#include "code\__DEFINES\projectiles\guns_legacy.dm"
#include "code\__DEFINES\projectiles\projectile.dm"
@@ -4508,7 +4508,6 @@
#include "code\modules\projectiles\guns\ballistic\shotgun.dm"
#include "code\modules\projectiles\guns\ballistic\sniper.dm"
#include "code\modules\projectiles\guns\ballistic\caseless\pellet.dm"
-#include "code\modules\projectiles\guns\ballistic\sniper\collapsible_sniper.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\medigun.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\medigun_cells.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\microbattery-casing.dm"
@@ -4516,6 +4515,7 @@
#include "code\modules\projectiles\guns\ballistic\microbattery\microbattery.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\revolver.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\revolver_cells.dm"
+#include "code\modules\projectiles\guns\ballistic\sniper\collapsible_sniper.dm"
#include "code\modules\projectiles\guns\energy\frontier.dm"
#include "code\modules\projectiles\guns\energy\hooklauncher.dm"
#include "code\modules\projectiles\guns\energy\laser.dm"
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
index e4c5efb98ed0..ff0b098a997c 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-ammo.dm
@@ -4,8 +4,20 @@
/obj/item/ammo_casing/nt_protomag
name = "protomag casing"
desc = "An obnoxiously long casing for some kind of rifle."
+ icon = 'icons/content/factions/corporations/nanotrasen/items/guns/protomag/ammo.dmi'
+ icon_state = "slug"
caliber = /datum/ammo_caliber/nt_protomag
+ /// override strip color
+ var/stripe_color
+
+/obj/item/ammo_casing/nt_protomag/Initialize(mapload)
+ . = ..()
+ var/image/stripe_image = image(icon, "[icon_state]-stripe")
+ var/obj/projectile/nt_protomag/casted_projectile = projectile_type
+ stripe_image.color = stripe_color || initial(casted_projectile.color)
+ add_overlay(stripe_image, TRUE)
+
/obj/item/ammo_casing/nt_protomag/magboosted
name = "protomag round"
desc = "A slender bullet. It seems to have less propellant than usual."
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm
index 33197965de74..ceff3dd74665 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-magazine.dm
@@ -1,7 +1,6 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//
-// todo: type-gen all of these.
/obj/item/ammo_magazine/nt_protomag
abstract_type = /obj/item/ammo_magazine/nt_protomag
desc = "A magazine for a magnetic weapon of some kind."
@@ -30,6 +29,7 @@
slot_flags = SLOT_POCKET
//* Boxes *//
+#warn these are rifle mags; make pistol mags the appropriate size. also, add stripes
/obj/item/ammo_magazine/nt_protomag/box
abstract_type = /obj/item/ammo_magazine/nt_protomag/box
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
index 07cac93a2513..6a7ffc40c5e6 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
@@ -3,11 +3,16 @@
/obj/projectile/nt_protomag
abstract_type = /obj/projectile/nt_protomag
+ icon = 'icons/content/factions/corporations/nanotrasen/items/guns/protomag/projectile.dmi'
+ icon_state = "kinetic"
/obj/projectile/nt_protomag/standard
+ name = "magnetic slug"
+ color = "#ccaa55"
/obj/projectile/nt_protomag/sabot
- name = "magnetic slug"
+ name = "dense slug"
+ color = "#ff7700"
// todo: this is currently disabled as medcode is not verbose enough for this to work
// /obj/projectile/nt_protomag/shredder
@@ -15,15 +20,19 @@
/obj/projectile/nt_protomag/impact
name = "deforming slug"
+ color = "#3333aa"
/obj/projectile/nt_protomag/practice
name = "lightweight slug"
+ color = "#ffffff"
/obj/projectile/nt_protomag/smoke
name = "disintegrating slug"
+ color = "#888888"
/obj/projectile/nt_protomag/emp
name = "ion slug"
+ color = "#aaaaff"
base_projectile_effects = list(
/datum/projectile_effect/detonation/legacy_emp{
sev_3 = 2;
@@ -36,12 +45,15 @@
/obj/projectile/nt_protomag/penetrator
name = "high-velocity slug"
+ color = "#aaffaa"
/obj/projectile/nt_protomag/shock
name = "piezo slug"
+ color = "#cccc55"
/obj/projectile/nt_protomag/flare
name = "tracer shot"
+ color = "#aa3333"
// todo: fuck no, rework fire stacks / fire first, holy crap; even then this should take multiple hits to ignite.
// /obj/projectile/nt_protomag/incendiary
diff --git a/code/game/rendering/plane_masters/plane_master.dm b/code/game/rendering/plane_masters/plane_master.dm
index 93acb24cf66d..66278e7ee4b1 100644
--- a/code/game/rendering/plane_masters/plane_master.dm
+++ b/code/game/rendering/plane_masters/plane_master.dm
@@ -94,6 +94,7 @@
/atom/movable/screen/plane_master/emissive/Initialize(mapload)
. = ..()
add_filter("em_block_masking", 1, color_matrix_filter(GLOB.em_mask_matrix))
+ #warn bloom filter
/atom/movable/screen/plane_master/lightmask
plane = LIGHTMASK_PLANE
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/protomag/ammo.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/protomag/ammo.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..113839045f8168e2d687d8a58e4ac79694e66a71
GIT binary patch
literal 307
zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|e{s5m4*8>L*gvAv0PF=Y7_(^?D
z2QT};0H73ONswPKgTu2MX+TbGRY*jMOKNd)QD#9&W_}(6L&conu!5q}?_YuoK7M_o
z<*loA?#%h%4WR}XjUPPHIq#!+lA)-lcZY>>knv?>FNHaeCLNg+q7b~&V!26dXScEH
z<`ohrOrJdR(e^sy+qxl8FMGa;?bF$Ai;W=k3&;hav`VWf)6aQGOQo9Bv=F4hSf02aoWQ`4{Dhg~&j)WuprH(&u6{1-oD!M<^Al^(
literal 0
HcmV?d00001
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/protomag/magazines.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/protomag/magazines.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..511e86c793e3840f29c4c475bfa5daaa3ff5eddd
GIT binary patch
literal 520
zcmV+j0{8uiP)&z`(#zRb((VM%mffj*pnAMT4{e0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRL
zOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5sVFloCsj8$u|SE7GbOXA7$|1Q#hF%=n41b=
zqpBoMm2PordTwf72|?8bnZ+gfIYcVcHN>S*S;5uM1?+tQa!N|rpRwSm0002{Nkl9l+=-RSY`1)S5sXaJ)F&S?w1g<2{|Xs%8%S~P6IFi8n&Dh2Fir7RvXS60%XHE
zp
zWN7}u#cCqR!`Pys{ralO+6>0amE^;{0;O=Po3?}M-s%_nK+6nQD9;zIRHWOdU`YAuKytq6EN;SGx{hCk>*2llnqXf
z4@^qwqHOtVpSGu!$CYM#oB$;=WKp3vB#%dmc%(c+QmDIXJBlx87@vgg70NdN0099>
zL_t(&f$iDdZi6rkhGAH02u^?Q|85tDl{M{1qdhr(INqfnP#g{dCX-hb{hN(#A&gLcc)x2Jmhg*V5h-*yd7XeYv1!#TMc%-Z-E$7
z3i*C2)l6+Q*!8Xjk|b448e(lbLiNY|-eA|e78p_*^DWvWk+0i}xwZwie6PW)%+F+f
zpPQFl>io~nFHiXQ`FkwTn%~R4^M{nbQq3Qdy?@UFz4_h)`WqZP9{>OVZ{l1WmtP9c
z0vD^s0avU2{Ccx$EC2ui0002if9D(d+|B21KDQR=G)zl3U%L6ySO5S30RQC^vXBmA
TQ_#+E00000NkvXXu0mjfMYRBK
literal 0
HcmV?d00001
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/protomag/projectile.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/protomag/projectile.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..ecaf2742e5fac249b4c340169f651e44640e69da
GIT binary patch
literal 552
zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=9aSL_B`&GO$wiq3C7Jno3=9=>
za!(ub9Wvlyy7rL{pm
z^SLFC-<@~IJNRsZj8#$OmuauX!n`~7gWbDn=2^|9?cq(U85!*6e%`y|`g);&dB22`YnUR|b$MH9XK9Jr?Y;a^Ev!koTdegn$}<_!}W${5Uq4)7gtW4gh3!-K(^
zL7FpxJwX|yzfHU#oqfi#&RuoazcWW&c>A{@>`R^f0pICBp3xt@0M!L^*xqU`H9z;c
z^47}<;-(F<4ZY8uU;HpFJNbckLc^`jr}O{6sAOlj!oXR;`C{+C1}Ozb99F4-^n%>;
alkvBB@HyUv#a+OtXYh3Ob6Mw<&;$T_MCphC
literal 0
HcmV?d00001
diff --git a/icons/content/factions/corporations/nanotrasen/items/guns/protomag/rifle.dmi b/icons/content/factions/corporations/nanotrasen/items/guns/protomag/rifle.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..9f115516cf75f0693b863bcec317a05a845cccb2
GIT binary patch
literal 606
zcmV-k0-^nhP)fFDZ*Bkpc$}4z%?g7s49CyyQv|(^F+Z-m3}twj?~u``
z0qdj2(fDF8TT;e?n5Y)Yqnk>elEdInR#?&QKmtS}km32tko+H4yiMY=IXP
z3T|St2glt=VA#(iz7nkrJ0EJ9R-HpjoBxBjqo=5L5pppLECm3_&ay+5AxlB@H+@)5
zD@O}Y=KshnT0|aA6wyQ(Ltu|@o_6n_LfuyDM|=PtY@F~{xwOsz00AONL_t(oh3%L<
zj)O1|Mqy9jnKD)EE;W{X60ShQEvTTx74D+F23&zVtqFu+BLn$Snw{66CyhUUh{DKG
zL=c|`cRUD4DFHa=Z1OZsm%bv)vZcmcDTSgaG@Cq0l7(*upb-4mXk(hPtSUA-;OqlG
zMhDBsO<8HI3Srj)u*m`MJ_b}pIN)Nmz~4B(L-&2!bF8;(JK%yqD7Vo#R}214{X>UT;UN
sfzz7-c=&cH6i~kz08id65X8UW54pQgm6%u#DF6Tf07*qoM6N<$f;3G5oB#j-
literal 0
HcmV?d00001
From e4a7a3e328630d116c7756d3912f86c800cfdd96 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sun, 10 Nov 2024 17:34:51 -0500
Subject: [PATCH 68/68] emissive
---
.../nanotrasen/items/guns/nt_protomag-projectile.dm | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
index 6a7ffc40c5e6..de6f55882b37 100644
--- a/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
+++ b/code/game/content/factions/corporations/nanotrasen/items/guns/nt_protomag-projectile.dm
@@ -5,6 +5,13 @@
abstract_type = /obj/projectile/nt_protomag
icon = 'icons/content/factions/corporations/nanotrasen/items/guns/protomag/projectile.dmi'
icon_state = "kinetic"
+ overlays = list(
+ /image{
+ icon_state = "kinetic-emissive";
+ plane = EMISSIVE_PLANE;
+ layer = MANGLE_PLANE_AND_LAYER(/obj/projectile/nt_protomag::plane, /obj/projectile/nt_protomag::layer);
+ }
+ )
/obj/projectile/nt_protomag/standard
name = "magnetic slug"