From 120f78ec0921e65f789bf58e159299ca7b5c1541 Mon Sep 17 00:00:00 2001 From: Anthcny <109621283+Anthcny144@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:48:08 +0200 Subject: [PATCH] Make the star item droppable (#53) * Make the star item droppable * Make the star item droppable * Fix issues --------- Co-authored-by: BuildTools --- images/sprites/sprite_etoile.png | Bin 0 -> 227 bytes php/pages/challengeZone.php | 2 +- scripts/mk.js | 80 ++++++++++++++++++++++--------- 3 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 images/sprites/sprite_etoile.png diff --git a/images/sprites/sprite_etoile.png b/images/sprites/sprite_etoile.png new file mode 100644 index 0000000000000000000000000000000000000000..aad8f1e09624419631a8ebb1060358c15e9a38fe GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+7ApQS8!~Z!znqk%bm}fwWr6kBN_&-q8L2Km~AfL0qBeIx*f$uN~ zGak=hkpdJ9@N{tu(Fkts_ZDJM;BY$ouKxKC58dSEJ(7iMa<9rByLQUt8}kXpRL-7R zidiwjiS0(#9y}95xs(pbD6sCi6{(n^u|T3^e%^!dPL_AiC9>szTxQ(tt2bE#Xf}hV LtDnm{r-UW|t^7s` literal 0 HcmV?d00001 diff --git a/php/pages/challengeZone.php b/php/pages/challengeZone.php index 97f06127..c1d9f085 100755 --- a/php/pages/challengeZone.php +++ b/php/pages/challengeZone.php @@ -1227,7 +1227,7 @@ function feedCustomDecorData(res) {
diff --git a/scripts/mk.js b/scripts/mk.js index bf8459cb..5fbe841f 100755 --- a/scripts/mk.js +++ b/scripts/mk.js @@ -859,11 +859,11 @@ var oPlanWidth, oPlanSize, oPlanRealSize, oCharWidth, oObjWidth, oCoinWidth, oEx var oPlanWidth2, oPlanSize2, oCharWidth2, oObjWidth2, oCoinWidth2, oExpWidth2, oExpBWidth2; var oCharRatio, oPlanRatio; var oPlanCharacters = new Array(), oPlanObjects = new Array(), oPlanCoins = new Array(), oPlanPoisons = new Array(), oPlanDecor = {}, oPlanAssets = {}, oPlanSea, - oPlanFauxObjets = new Array(), oPlanBananes = new Array(), oPlanBobOmbs = new Array(), oPlanChampis = new Array(), + oPlanFauxObjets = new Array(), oPlanBananes = new Array(), oPlanBobOmbs = new Array(), oPlanChampis = new Array(), oPlanEtoilesDrop = new Array(), oPlanCarapaces = new Array(), oPlanCarapacesRouges = new Array(), oPlanCarapacesBleues = new Array(), oPlanCarapacesNoires = new Array(), oPlanEtoiles = new Array(), oPlanBillballs = new Array(), oPlanTeams = new Array(); var oPlanCharacters2 = new Array(), oPlanObjects2 = new Array(), oPlanCoins2 = new Array(), oPlanDecor2 = {}, oPlanAssets2 = {}, oPlanSea2, - oPlanFauxObjets2 = new Array(), oPlanBananes2 = new Array(), oPlanBobOmbs2 = new Array(), oPlanPoisons2 = new Array(), oPlanChampis2 = new Array(), + oPlanFauxObjets2 = new Array(), oPlanBananes2 = new Array(), oPlanBobOmbs2 = new Array(), oPlanPoisons2 = new Array(), oPlanChampis2 = new Array(), oPlanEtoilesDrop2 = new Array(), oPlanCarapaces2 = new Array(), oPlanCarapacesRouges2 = new Array(), oPlanCarapacesBleues2 = new Array(), oPlanCarapacesNoires2 = new Array(), oPlanEtoiles2 = new Array(), oPlanBillballs2 = new Array(), oPlanTeams2 = new Array(); var customDecorFetchHandlers = [{plan:oPlanDecor,list:{}},{plan:oPlanDecor2,list:{}}]; @@ -1164,6 +1164,14 @@ function setPlanPos(frameState, lMap) { setObject(oPlanChampis2[i],champi.x,champi.y, oObjWidth2,oPlanSize2, -1,100); oPlanChampis[i].style.zIndex = oPlanChampis2[i].style.zIndex = 2; } + syncObjects(oPlanEtoilesDrop,frameItems["etoile"],"etoile", oObjWidth,oPlanCtn); + syncObjects(oPlanEtoilesDrop2,frameItems["etoile"],"etoile", oObjWidth2,oPlanCtn2); + for (var i=0;i 0) + oKart.speedinc *= 5; + delete oKart.shift; + oKart.protect = true; + oKart.etoile = duration; +} + var CHAMPI_TYPE_ITEM = 1, CHAMPI_TYPE_BOOST = 2; function arme(ID, backwards, forwards) { var oKart = aKarts[ID]; @@ -2370,25 +2404,7 @@ function arme(ID, backwards, forwards) { case "etoile" : tpsUse = 80; - for (var i=0;i 0) - oKart.speedinc *= 5; - delete oKart.shift; - oKart.protect = true; + setStarState(oKart, tpsUse); break; case "billball" : @@ -6986,6 +7002,11 @@ var itemBehaviors = { sync: [floatType("x"),floatType("y"),floatType("z")], fadedelay: 100 }, + "etoile": { + size: 0.54, + sync: [floatType("x"),floatType("y"),floatType("z")], + fadedelay: 100 + }, "eclair": { size: 1, sync: [intType("owner")], @@ -8182,7 +8203,7 @@ var itemBehaviors = { } } } -var itemTypes = ["banane","fauxobjet","carapace","bobomb","poison","carapace-rouge","carapace-bleue","carapace-noire","eclair","bloops","champi"]; +var itemTypes = ["banane","fauxobjet","carapace","bobomb","poison","carapace-rouge","carapace-bleue","carapace-noire","eclair","bloops","champi","etoile"]; var items = {}; for (var i=0;i oBox.x - 4 && iX < oBox.x + 4 && iY > oBox.y - 4 && iY < oBox.y + 4) { + detruit(oBox); + return true; + } + } + return false; +} + function touche_fauxobjet(iX, iY, iP) { if (!iP) iP = []; for (var i=0;i 1.5 && touche_etoile(fMidPosX, fMidPosY))) && !oKart.tourne && !oKart.billball) { + setStarState(oKart, 80); + } else if (!oKart.tourne && (oKart.z < 1.2)) { var hittable = !oKart.protect && !oKart.frminv; var asset = touche_asset(aPosX,aPosY,fNewPosX,fNewPosY);