From 18808da5437552fea2ee62ae3715acb420490bec Mon Sep 17 00:00:00 2001 From: David Dormagen Date: Tue, 1 Sep 2015 13:36:03 +0200 Subject: [PATCH] object pickup: reworked selector effect The reworked effect makes it clearer that this is a meta-action and is not part of the ingame world. --- .../Particles.ocd/Selector.ocd/Graphics.png | Bin 0 -> 2052 bytes .../Particles.ocd/Selector.ocd/Particle.txt | 3 ++ .../ClonkInventoryControl.ocd/Script.c | 30 ++++++------------ 3 files changed, 13 insertions(+), 20 deletions(-) create mode 100644 planet/Objects.ocd/Effects.ocd/Particles.ocd/Selector.ocd/Graphics.png create mode 100644 planet/Objects.ocd/Effects.ocd/Particles.ocd/Selector.ocd/Particle.txt diff --git a/planet/Objects.ocd/Effects.ocd/Particles.ocd/Selector.ocd/Graphics.png b/planet/Objects.ocd/Effects.ocd/Particles.ocd/Selector.ocd/Graphics.png new file mode 100644 index 0000000000000000000000000000000000000000..e4e0c7d7742c1c5a5ec1a244e976c1a4ffe01f33 GIT binary patch literal 2052 zcmV+f2>bVmP) z000W>0fLJSS^xkCwn;=mRCt{2on44kRTRfZW@tp6gg)$pC?CQU$3#cW$~2+O9H<8? zAEF2Qus{mJ>LDbEiX<5*6#@(TcrXa5M9Sz(l1e5WABLKW@WCV~BqIVTV)*s2&&8QL z=ial%af&Klf{|yLT7RrRZD)C!kORDAWK7HGo15pil!S)BsM< z2Mhw6foFi-z+T`(;4p9$7zKU+egb|3z6Xv2-vFNi`+(Pg?ZD%}J-`ZJP6X>y1GK>` zU;{9MpBMpdj$oZ?fCST0&;zUmhFdhzHinbDJt;M%Ttn+s3j?Gzy&2uWdSEQImHA^V z$=5BY9ev{)2u`2?BqrzuHUVc+8k#50Bzby;bsG)O^XQ-kuz;iy7Xd?4dzveTl04Gp z+dMs}0W2VGzyS6y3P+OPuT|q42u{EeBu@oT0ORC~@#OdNJoHzl`P9e&%_eB|f97J| z!Yv0D0rP=*z%{@^U@34TunyP=+>}vA4WLLhMQA>1fB>jm^VI`NuAeKrbv|*s;(%r`E@iv8Ef)d!#8=`ZPTj2=Xy%f%@_GwfnC51HGne%c&X)s z_+`K^z<$j5R9PRBmTfNIYe~Z#;ELD{Z~zlyK!2OXRHYeZ*38;p=udQA;i{%i7uYb1m%*up!a)xT|_DiLYX63}J>e%X$q^mI-{XC9V0hm^|3B(?unQ- zMuEj82v#=AdiysKixWL3#+^m$xFY)^>Crq;5xQ|zX@0W_S`Dv?k8 zkT@tHabE;t)e$|wDS`giN^|BVaEqY$p$LSkGd2r)@P;&B-r@(yj!A>LHoqEB19Ujl0E+y*QUlZrr5ivE z5nrQo^}ximm%VHAN3pr|l{ z6HurD6lws48bDEL1L(Veio&G<^m73JaIULQ1E?YV=o*~?bU(m<)4gd|wgEzmTV+IP z0Bv%`QMB>F7oaHD0Q%QnEoAn}rs-;cIAPT%H9&n3!~kl7c;L+d*2xu7G~bB<^vj`f z!}wf@M5`lW)CA$s?vSWsS-&qW zaxs%b4~Ytom9#%54$SE;P7Kfm>>)iG$HbikE{#B#PQkY=`q7AgfZ17j@)TT}Q4rvx z2!!bb+$-qC%aUAq3%@5QJQ#sMbw~64foUPSHz04}wA(?OXHW|5UP%t3H&C|f4(%Q4T+Tk0;ec=qopDhI|SOlnkT0%k-Y*Uxi2tMw8elxbAYSz z5&F_NXXBp%G-j6`YszP#m`1Q8=T@YNB zL5^erp@pm>8au56m@WCV*iod0E27V~AV)%c0NpY!Vt`)EP|n1iJ}|q0g>-dE_6SpB zJR#njlW6Q_DT810kjG-C?g89hw2n){*D*Cl6XH5ORIK@pDW8e21qwa%H{hE1lT3~w z(g#XI3mh}r&G&7<4C5SeRnNx)8duAoO$bYe71bEo<{-EYG_(P_FjvU#Cw+ogO<->T=k zNRX!)(`Y|aCy61+!OEjaLyuw1av1moa}>^7m~(cvVNOCD1QuZqX$ZYGHGo15pil!S i)Bp-KfIMessage("@%s", item->GetName()); // Center dummy! @@ -181,38 +181,28 @@ private func FxIntHighlightItemStart(object target, proplist fx, temp, object it fx.width = item->GetDefWidth(); fx.height = item->GetDefHeight(); - var particle = - { - Prototype = Particles_Flash(), - Size = Max(fx.width, fx.height), - Attach = ATTACH_Front - }; - fx.dummy->CreateParticle("SphereSpark", 0, 0, 0, 0, 20, particle, 1); + // Draw the item's graphics in front of it again to achieve a highlighting effect. + fx.dummy->SetGraphics(nil, nil, 1, GFXOV_MODE_Object, nil, GFX_BLIT_Additive, item); - // And smaller sparks during the effect. - fx.particles = + // Draw a nice selector particle on item change. + var selector = { - Prototype = particle, - Size = PV_Linear(2, 0), - Rotation = PV_Random(360), - Stretch = PV_Linear(0, 4000), + Size = PV_Step(3, 2, 1, Max(fx.width, fx.height)), + Attach = ATTACH_Front, + Rotation = PV_Step(1, PV_Random(0, 360), 1), + Alpha = 200 }; - fx.width /= 2; - fx.height /= 2; + fx.dummy->CreateParticle("Selector", 0, 0, 0, 0, 0, Particles_Colored(selector, GetPlayerColor(GetOwner())), 1); } -private func FxIntHighlightItemTimer(object target, proplist fx, int time) { if (!fx.dummy) return -1; if (!fx.item) return -1; if (ObjectDistance(this, fx.item) > 20) return -1; if (fx.item->Contained()) return -1; - - fx.dummy->CreateParticle("StarSpark", PV_Random(-fx.width, fx.width), PV_Random(-fx.height, fx.height), 0, 0, 10, fx.particles, 2); } -private func FxIntHighlightItemStop(object target, proplist fx, int reason, temp) { if (temp) return; if (fx.dummy) fx.dummy->RemoveObject();