https://pvzm.net/ to play [Read-only GitHub mirror] pvzm.net
modded vs pvz plants-vs-zombies plantsvszombies javascript online zombie noads jspvz pvzm game plants plant
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

(online levels) HUGE UPDATE!!

Clay 6310bb69 64e8708e

+5872 -5350
+40 -20
.github/workflows/main.yml
··· 33 33 - name: Beautify code 34 34 run: | 35 35 npm run fix || true 36 - npx prettier --write "**/*.{js,md,html,css,yml}" 36 + npx oxfmt --write . "**/*.{js,md,html,css,yml}" 37 37 38 38 - name: Create v.html with commit hash 39 39 run: | 40 40 echo "${{ github.sha }}" > game/images/Zombies/CX/v.html 41 41 42 - - name: Get commit message 42 + - name: Get commit message & author email 43 43 id: get_commit_message 44 44 run: | 45 45 COMMIT_MSG=$(git log -1 --pretty=format:%s) 46 + AUTHOR_EMAIL=$(git log -1 --pretty=format:%ae) 46 47 echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT 48 + echo "author_email=$AUTHOR_EMAIL" >> $GITHUB_OUTPUT 47 49 48 50 - name: Commit changes 49 51 run: | 50 52 git config user.name github-actions 51 53 git config user.email github-actions@github.com 52 54 git add . 53 - git commit -m "${{ github.actor }} - ${{ steps.get_commit_message.outputs.message }} 54 - Original commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }}" || exit 0 55 + git commit -m "Format \"${{ steps.get_commit_message.outputs.message }}\" 56 + Original commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} 57 + 58 + Co-authored-by: ${{ github.actor }} <${{ steps.get_commit_message.outputs.author_email }}>" || exit 0 55 59 git push 56 60 57 61 deploy: ··· 68 72 69 73 - name: Install minification tools 70 74 run: | 71 - npm install -g terser uglify-js clean-css-cli html-minifier 72 - 73 - - name: Minify JavaScript files 74 - run: | 75 - find . -type f -name "*.js" -not -path "./node_modules/*" | while read file; do 76 - file_basename=$(basename "$file") 77 - file_dirname=$(dirname "$file") 78 - map_filename="$file_dirname/$file_basename.map" 79 - terser "$file" --compress --mangle --source-map "base='.',root='/original-sources',url='$file_basename.map',filename='$map_filename',includeSources=true" -o "$file" 80 - done 75 + npm install -g esbuild html-minifier-terser 81 76 82 - - name: Minify CSS files 77 + - name: Minify JavaScript & CSS files 83 78 run: | 84 - find . -type f -name "*.css" -not -path "./node_modules/*" | while read file; do 85 - cleancss -o "$file" --source-map --source-map-inline-sources "$file" 86 - done 79 + esbuild $(find . -type f \( -name "*.js" -o -name "*.css" \) -not -path "./node_modules/*") \ 80 + --minify \ 81 + --sourcemap \ 82 + --sources-content=true \ 83 + --outdir=. \ 84 + --allow-overwrite 87 85 88 86 - name: Minify HTML files 89 87 run: | 90 88 find . -type f -name "*.html" -not -path "./node_modules/*" | while read file; do 91 - html-minifier --collapse-whitespace --remove-comments --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --minify-css true --minify-js true -o "$file.min" "$file" 92 - mv "$file.min" "$file" 89 + html-minifier-terser \ 90 + --collapse-whitespace \ 91 + --remove-comments \ 92 + --remove-tag-whitespace \ 93 + --minify-css true \ 94 + --minify-js true \ 95 + -o "$file" \ 96 + "$file" 93 97 done 94 98 95 99 - name: Deploy to Cloudflare Pages (Direct Upload) ··· 99 103 accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 100 104 command: pages deploy . --project-name=pvz 101 105 gitHubToken: ${{ secrets.GITHUB_TOKEN }} 106 + 107 + # discord-notify: 108 + # runs-on: ubuntu-latest 109 + # needs: [version-file-and-lint, deploy] 110 + # if: always() 111 + # steps: 112 + # - name: Notify Discord 113 + # uses: sarisia/actions-status-discord@v1 114 + # if: always() 115 + # with: 116 + # webhook: ${{ secrets.DISCORD_WEBHOOK }} 117 + # ack_no_webhook: true 118 + # status: ${{ (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped')) && 'Failure' || contains(needs.*.result, 'cancelled') && 'Cancelled' || 'Success' }} 119 + # title: ${{ github.workflow }} 120 + # description: ${{ github.repository }} @ ${{ github.ref_name }}\n${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} 121 + # url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+51
.oxlintrc.json
··· 1 + { 2 + "$schema": "./node_modules/oxlint/configuration_schema.json", 3 + "plugins": [], 4 + "categories": { 5 + "correctness": "off" 6 + }, 7 + "env": { 8 + "builtin": true 9 + }, 10 + "overrides": [ 11 + { 12 + "files": [ 13 + "**/*.{js,mjs,cjs}" 14 + ], 15 + "rules": { 16 + "curly": [ 17 + "error", 18 + "all" 19 + ], 20 + "eqeqeq-fix/eqeqeq": [ 21 + "error", 22 + "smart" 23 + ], 24 + "prefer-spread": "error", 25 + "prefer-rest-params": "error", 26 + "no-sequences": "error", 27 + "no-nested-ternary": "error", 28 + "no-unneeded-ternary": "error", 29 + "no-else-return": "error", 30 + "operator-assignment": "error", 31 + "no-useless-rename": "error", 32 + "no-useless-computed-key": "error", 33 + "no-useless-concat": "error", 34 + "no-useless-return": "error", 35 + "complexity": [ 36 + "warn", 37 + 15 38 + ], 39 + "prefer-object-spread": "warn", 40 + "no-lonely-if": "warn", 41 + "no-extra-boolean-cast": "warn" 42 + }, 43 + "jsPlugins": [ 44 + "eslint-plugin-eqeqeq-fix" 45 + ], 46 + "env": { 47 + "browser": true 48 + } 49 + } 50 + ] 51 + }
-4
.prettierignore
··· 1 - game/js/pako.js 2 - game/js/html2canvas.js 3 - .github/workflows 4 - pnpm-lock.yaml
+3 -2
.prettierrc .oxfmtrc.json
··· 1 1 { 2 + "$schema": "./node_modules/oxfmt/configuration_schema.json", 2 3 "tabWidth": 4, 3 4 "useTabs": true, 4 5 "arrowParens": "always", ··· 6 7 "bracketSpacing": true, 7 8 "embeddedLanguageFormatting": "auto", 8 9 "endOfLine": "lf", 9 - "experimentalTernaries": false, 10 10 "htmlWhitespaceSensitivity": "css", 11 11 "insertPragma": false, 12 12 "printWidth": 160, ··· 15 15 "semi": true, 16 16 "singleAttributePerLine": false, 17 17 "singleQuote": false, 18 - "trailingComma": "es5" 18 + "trailingComma": "es5", 19 + "ignorePatterns": ["game/js/pako.js", "game/js/html2canvas.js", "game/js/msgpack.min.js", ".github/workflows", "pnpm-lock.yaml"] 19 20 }
+124 -133
LICENSE
··· 67 67 Licensor receives from making the Licensed Material available under 68 68 these terms and conditions. 69 69 70 - 71 70 Section 1 -- Definitions. 72 71 73 - a. Adapted Material means material subject to Copyright and Similar 74 - Rights that is derived from or based upon the Licensed Material 75 - and in which the Licensed Material is translated, altered, 76 - arranged, transformed, or otherwise modified in a manner requiring 77 - permission under the Copyright and Similar Rights held by the 78 - Licensor. For purposes of this Public License, where the Licensed 79 - Material is a musical work, performance, or sound recording, 80 - Adapted Material is always produced where the Licensed Material is 81 - synched in timed relation with a moving image. 72 + a. Adapted Material means material subject to Copyright and Similar 73 + Rights that is derived from or based upon the Licensed Material 74 + and in which the Licensed Material is translated, altered, 75 + arranged, transformed, or otherwise modified in a manner requiring 76 + permission under the Copyright and Similar Rights held by the 77 + Licensor. For purposes of this Public License, where the Licensed 78 + Material is a musical work, performance, or sound recording, 79 + Adapted Material is always produced where the Licensed Material is 80 + synched in timed relation with a moving image. 82 81 83 - b. Copyright and Similar Rights means copyright and/or similar rights 84 - closely related to copyright including, without limitation, 85 - performance, broadcast, sound recording, and Sui Generis Database 86 - Rights, without regard to how the rights are labeled or 87 - categorized. For purposes of this Public License, the rights 88 - specified in Section 2(b)(1)-(2) are not Copyright and Similar 89 - Rights. 82 + b. Copyright and Similar Rights means copyright and/or similar rights 83 + closely related to copyright including, without limitation, 84 + performance, broadcast, sound recording, and Sui Generis Database 85 + Rights, without regard to how the rights are labeled or 86 + categorized. For purposes of this Public License, the rights 87 + specified in Section 2(b)(1)-(2) are not Copyright and Similar 88 + Rights. 90 89 91 - c. Effective Technological Measures means those measures that, in the 92 - absence of proper authority, may not be circumvented under laws 93 - fulfilling obligations under Article 11 of the WIPO Copyright 94 - Treaty adopted on December 20, 1996, and/or similar international 95 - agreements. 90 + c. Effective Technological Measures means those measures that, in the 91 + absence of proper authority, may not be circumvented under laws 92 + fulfilling obligations under Article 11 of the WIPO Copyright 93 + Treaty adopted on December 20, 1996, and/or similar international 94 + agreements. 96 95 97 - d. Exceptions and Limitations means fair use, fair dealing, and/or 98 - any other exception or limitation to Copyright and Similar Rights 99 - that applies to Your use of the Licensed Material. 96 + d. Exceptions and Limitations means fair use, fair dealing, and/or 97 + any other exception or limitation to Copyright and Similar Rights 98 + that applies to Your use of the Licensed Material. 100 99 101 - e. Licensed Material means the artistic or literary work, database, 102 - or other material to which the Licensor applied this Public 103 - License. 100 + e. Licensed Material means the artistic or literary work, database, 101 + or other material to which the Licensor applied this Public 102 + License. 104 103 105 - f. Licensed Rights means the rights granted to You subject to the 106 - terms and conditions of this Public License, which are limited to 107 - all Copyright and Similar Rights that apply to Your use of the 108 - Licensed Material and that the Licensor has authority to license. 104 + f. Licensed Rights means the rights granted to You subject to the 105 + terms and conditions of this Public License, which are limited to 106 + all Copyright and Similar Rights that apply to Your use of the 107 + Licensed Material and that the Licensor has authority to license. 109 108 110 - g. Licensor means the individual(s) or entity(ies) granting rights 111 - under this Public License. 109 + g. Licensor means the individual(s) or entity(ies) granting rights 110 + under this Public License. 112 111 113 - h. NonCommercial means not primarily intended for or directed towards 114 - commercial advantage or monetary compensation. For purposes of 115 - this Public License, the exchange of the Licensed Material for 116 - other material subject to Copyright and Similar Rights by digital 117 - file-sharing or similar means is NonCommercial provided there is 118 - no payment of monetary compensation in connection with the 119 - exchange. 120 - 121 - i. Share means to provide material to the public by any means or 122 - process that requires permission under the Licensed Rights, such 123 - as reproduction, public display, public performance, distribution, 124 - dissemination, communication, or importation, and to make material 125 - available to the public including in ways that members of the 126 - public may access the material from a place and at a time 127 - individually chosen by them. 112 + h. NonCommercial means not primarily intended for or directed towards 113 + commercial advantage or monetary compensation. For purposes of 114 + this Public License, the exchange of the Licensed Material for 115 + other material subject to Copyright and Similar Rights by digital 116 + file-sharing or similar means is NonCommercial provided there is 117 + no payment of monetary compensation in connection with the 118 + exchange. 128 119 129 - j. Sui Generis Database Rights means rights other than copyright 130 - resulting from Directive 96/9/EC of the European Parliament and of 131 - the Council of 11 March 1996 on the legal protection of databases, 132 - as amended and/or succeeded, as well as other essentially 133 - equivalent rights anywhere in the world. 120 + i. Share means to provide material to the public by any means or 121 + process that requires permission under the Licensed Rights, such 122 + as reproduction, public display, public performance, distribution, 123 + dissemination, communication, or importation, and to make material 124 + available to the public including in ways that members of the 125 + public may access the material from a place and at a time 126 + individually chosen by them. 134 127 135 - k. You means the individual or entity exercising the Licensed Rights 136 - under this Public License. Your has a corresponding meaning. 128 + j. Sui Generis Database Rights means rights other than copyright 129 + resulting from Directive 96/9/EC of the European Parliament and of 130 + the Council of 11 March 1996 on the legal protection of databases, 131 + as amended and/or succeeded, as well as other essentially 132 + equivalent rights anywhere in the world. 137 133 134 + k. You means the individual or entity exercising the Licensed Rights 135 + under this Public License. Your has a corresponding meaning. 138 136 139 137 Section 2 -- Scope. 140 138 141 - a. License grant. 139 + a. License grant. 142 140 143 141 1. Subject to the terms and conditions of this Public License, 144 142 the Licensor hereby grants You a worldwide, royalty-free, ··· 193 191 the Licensor or others designated to receive attribution as 194 192 provided in Section 3(a)(1)(A)(i). 195 193 196 - b. Other rights. 194 + b. Other rights. 197 195 198 196 1. Moral rights, such as the right of integrity, are not 199 197 licensed under this Public License, nor are publicity, ··· 215 213 the Licensed Material is used other than for NonCommercial 216 214 purposes. 217 215 218 - 219 216 Section 3 -- License Conditions. 220 217 221 218 Your exercise of the Licensed Rights is expressly made subject to the 222 219 following conditions. 223 220 224 - a. Attribution. 221 + a. Attribution. 225 222 226 223 1. If You Share the Licensed Material, You must: 227 224 ··· 265 262 information required by Section 3(a)(1)(A) to the extent 266 263 reasonably practicable. 267 264 268 - 269 265 Section 4 -- Sui Generis Database Rights. 270 266 271 267 Where the Licensed Rights include Sui Generis Database Rights that 272 268 apply to Your use of the Licensed Material: 273 269 274 - a. for the avoidance of doubt, Section 2(a)(1) grants You the right 275 - to extract, reuse, reproduce, and Share all or a substantial 276 - portion of the contents of the database for NonCommercial purposes 277 - only and provided You do not Share Adapted Material; 270 + a. for the avoidance of doubt, Section 2(a)(1) grants You the right 271 + to extract, reuse, reproduce, and Share all or a substantial 272 + portion of the contents of the database for NonCommercial purposes 273 + only and provided You do not Share Adapted Material; 278 274 279 - b. if You include all or a substantial portion of the database 280 - contents in a database in which You have Sui Generis Database 281 - Rights, then the database in which You have Sui Generis Database 282 - Rights (but not its individual contents) is Adapted Material; and 275 + b. if You include all or a substantial portion of the database 276 + contents in a database in which You have Sui Generis Database 277 + Rights, then the database in which You have Sui Generis Database 278 + Rights (but not its individual contents) is Adapted Material; and 283 279 284 - c. You must comply with the conditions in Section 3(a) if You Share 285 - all or a substantial portion of the contents of the database. 280 + c. You must comply with the conditions in Section 3(a) if You Share 281 + all or a substantial portion of the contents of the database. 286 282 287 283 For the avoidance of doubt, this Section 4 supplements and does not 288 284 replace Your obligations under this Public License where the Licensed 289 285 Rights include other Copyright and Similar Rights. 290 286 291 - 292 287 Section 5 -- Disclaimer of Warranties and Limitation of Liability. 293 288 294 - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 295 - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 296 - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 297 - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 298 - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 299 - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 300 - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 301 - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 302 - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 303 - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 304 - 305 - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 306 - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 307 - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 308 - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 309 - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 310 - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 311 - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 312 - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 313 - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 289 + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 290 + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 291 + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 292 + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 293 + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 294 + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 295 + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 296 + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 297 + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 298 + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 314 299 315 - c. The disclaimer of warranties and limitation of liability provided 316 - above shall be interpreted in a manner that, to the extent 317 - possible, most closely approximates an absolute disclaimer and 318 - waiver of all liability. 300 + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 301 + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 302 + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 303 + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 304 + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 305 + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 306 + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 307 + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 308 + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 319 309 310 + c. The disclaimer of warranties and limitation of liability provided 311 + above shall be interpreted in a manner that, to the extent 312 + possible, most closely approximates an absolute disclaimer and 313 + waiver of all liability. 320 314 321 315 Section 6 -- Term and Termination. 322 316 323 - a. This Public License applies for the term of the Copyright and 324 - Similar Rights licensed here. However, if You fail to comply with 325 - this Public License, then Your rights under this Public License 326 - terminate automatically. 317 + a. This Public License applies for the term of the Copyright and 318 + Similar Rights licensed here. However, if You fail to comply with 319 + this Public License, then Your rights under this Public License 320 + terminate automatically. 327 321 328 - b. Where Your right to use the Licensed Material has terminated under 329 - Section 6(a), it reinstates: 322 + b. Where Your right to use the Licensed Material has terminated under 323 + Section 6(a), it reinstates: 330 324 331 325 1. automatically as of the date the violation is cured, provided 332 326 it is cured within 30 days of Your discovery of the ··· 338 332 right the Licensor may have to seek remedies for Your violations 339 333 of this Public License. 340 334 341 - c. For the avoidance of doubt, the Licensor may also offer the 342 - Licensed Material under separate terms or conditions or stop 343 - distributing the Licensed Material at any time; however, doing so 344 - will not terminate this Public License. 345 - 346 - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 347 - License. 335 + c. For the avoidance of doubt, the Licensor may also offer the 336 + Licensed Material under separate terms or conditions or stop 337 + distributing the Licensed Material at any time; however, doing so 338 + will not terminate this Public License. 348 339 340 + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 341 + License. 349 342 350 343 Section 7 -- Other Terms and Conditions. 351 344 352 - a. The Licensor shall not be bound by any additional or different 353 - terms or conditions communicated by You unless expressly agreed. 354 - 355 - b. Any arrangements, understandings, or agreements regarding the 356 - Licensed Material not stated herein are separate from and 357 - independent of the terms and conditions of this Public License. 345 + a. The Licensor shall not be bound by any additional or different 346 + terms or conditions communicated by You unless expressly agreed. 358 347 348 + b. Any arrangements, understandings, or agreements regarding the 349 + Licensed Material not stated herein are separate from and 350 + independent of the terms and conditions of this Public License. 359 351 360 352 Section 8 -- Interpretation. 361 353 362 - a. For the avoidance of doubt, this Public License does not, and 363 - shall not be interpreted to, reduce, limit, restrict, or impose 364 - conditions on any use of the Licensed Material that could lawfully 365 - be made without permission under this Public License. 354 + a. For the avoidance of doubt, this Public License does not, and 355 + shall not be interpreted to, reduce, limit, restrict, or impose 356 + conditions on any use of the Licensed Material that could lawfully 357 + be made without permission under this Public License. 366 358 367 - b. To the extent possible, if any provision of this Public License is 368 - deemed unenforceable, it shall be automatically reformed to the 369 - minimum extent necessary to make it enforceable. If the provision 370 - cannot be reformed, it shall be severed from this Public License 371 - without affecting the enforceability of the remaining terms and 372 - conditions. 359 + b. To the extent possible, if any provision of this Public License is 360 + deemed unenforceable, it shall be automatically reformed to the 361 + minimum extent necessary to make it enforceable. If the provision 362 + cannot be reformed, it shall be severed from this Public License 363 + without affecting the enforceability of the remaining terms and 364 + conditions. 373 365 374 - c. No term or condition of this Public License will be waived and no 375 - failure to comply consented to unless expressly agreed to by the 376 - Licensor. 366 + c. No term or condition of this Public License will be waived and no 367 + failure to comply consented to unless expressly agreed to by the 368 + Licensor. 377 369 378 - d. Nothing in this Public License constitutes or may be interpreted 379 - as a limitation upon, or waiver of, any privileges and immunities 380 - that apply to the Licensor or You, including from the legal 381 - processes of any jurisdiction or authority. 370 + d. Nothing in this Public License constitutes or may be interpreted 371 + as a limitation upon, or waiver of, any privileges and immunities 372 + that apply to the Licensor or You, including from the legal 373 + processes of any jurisdiction or authority. 382 374 383 375 ======================================================================= 384 376 ··· 400 392 public licenses. 401 393 402 394 Creative Commons may be contacted at creativecommons.org. 403 -
-65
eslint.config.mjs
··· 1 - import js from "@eslint/js"; 2 - import globals from "globals"; 3 - import eqeqeFix from "eslint-plugin-eqeqeq-fix"; 4 - 5 - export default [ 6 - { 7 - files: ["**/*.{js,mjs,cjs}"], 8 - ignores: ["**/node_modules/**", "**/html2canvas.js", "**/pako.js"], 9 - ...js.configs.recommended, 10 - languageOptions: { 11 - globals: { 12 - ...globals.browser, 13 - }, 14 - }, 15 - plugins: { 16 - "eqeqeq-fix": eqeqeFix, 17 - "autofix": { 18 - 19 - extends: ["plugin:eqeqeq-fix/recommended"], 20 - }, 21 - }, 22 - rules: { 23 - "one-var": ["error", "never"], 24 - curly: ["error", "all"], 25 - "eqeqeq-fix/eqeqeq": ["error", "smart"], 26 - // "no-var": "error", 27 - // "prefer-const": "error", 28 - "object-shorthand": "error", 29 - // "prefer-template": "error", 30 - // "prefer-destructuring": ["error", { object: true, array: true }], 31 - "prefer-spread": "error", 32 - "prefer-rest-params": "error", 33 - "no-sequences": "error", 34 - "no-nested-ternary": "error", 35 - "no-unneeded-ternary": "error", 36 - "no-else-return": "error", 37 - "dot-notation": "error", 38 - "operator-assignment": "error", 39 - // "no-multi-assign": "error", 40 - "no-useless-rename": "error", 41 - "no-useless-computed-key": "error", 42 - "no-useless-concat": "error", 43 - "no-useless-return": "error", 44 - 45 - complexity: ["warn", 15], 46 - // "max-lines-per-function": ["warn", 75], 47 - // "max-depth": ["warn", 4], 48 - // "max-params": ["warn", 5], 49 - // "no-shadow": "warn", 50 - // "no-param-reassign": ["warn", { props: false }], 51 - "prefer-arrow-callback": "warn", 52 - "prefer-object-spread": "warn", 53 - "no-lonely-if": "warn", 54 - "no-extra-boolean-cast": "warn", 55 - }, 56 - }, 57 - 58 - { 59 - files: ["**/*.js"], 60 - languageOptions: { 61 - sourceType: "script", 62 - }, 63 - }, 64 - ]; 65 -
+189
game/Custom.css
··· 792 792 .cardboard { 793 793 filter: url("#cardboard"); 794 794 } 795 + .cardboardNoShadow { 796 + filter: url("#cardboardNoShadow"); 797 + } 795 798 796 799 /*.balloonIdleSheet { 797 800 background-image: url(images/Zombies/Balloon/balloonidle.png); ··· 1005 1008 font-weight: normal !important; 1006 1009 } 1007 1010 /* yes i know this fix sucks*/ 1011 + 1012 + .iz-level-play { 1013 + color: #00c400; 1014 + text-shadow: 1015 + 1px 1px 0px rgb(92 97 111), 1016 + -1px -1.5px 0px rgba(0, 0, 0, 0.7); 1017 + font-size: x-large; 1018 + background: url(images/interface/Button_long.png) no-repeat; 1019 + background-size: 100% 100%; 1020 + line-height: 1.41; 1021 + border: none; 1022 + font-family: dwarventodcraft !important; 1023 + width: 170px; 1024 + height: 37px; 1025 + position: absolute; 1026 + bottom: 5px; 1027 + left: 10px; 1028 + text-align: center; 1029 + padding-bottom: 5px; 1030 + cursor: url(images/interface/Pointer.cur), pointer; 1031 + } 1032 + .iz-level-play:hover { 1033 + color: #01e901; 1034 + } 1035 + .iz-level-favorite { 1036 + box-shadow: 1037 + 0 4px 1px -1px rgb(0 0 0 / 0.4), 1038 + 0 2px 1px -2px rgb(0 0 0 / 0.4); 1039 + position: absolute !important; 1040 + top: 168px !important; 1041 + left: 185px !important; 1042 + height: 33px !important; 1043 + width: 80px !important; 1044 + } 1045 + .iz-level-report { 1046 + display: inline-block; 1047 + width: 1.35em; 1048 + height: 1.35em; 1049 + vertical-align: -0.3375em; 1050 + background: url("images/interface/icon_exclamation.png") no-repeat; 1051 + background-size: contain; 1052 + position: absolute; 1053 + top: 5px; 1054 + right: 5px; 1055 + border-width: 0; 1056 + } 1057 + .iz-level-title { 1058 + font-size: x-large; 1059 + font-weight: bolder; 1060 + margin: 7px 10px 0 10px; 1061 + color: #28325a; 1062 + display: -webkit-box; 1063 + -webkit-box-orient: vertical; 1064 + -webkit-line-clamp: 2; 1065 + line-clamp: 2; 1066 + overflow-wrap: break-word; 1067 + text-overflow: ellipsis; 1068 + overflow: hidden; 1069 + } 1070 + .iz-level { 1071 + box-shadow: 1072 + 0 4px 6px -1px rgb(0 0 0 / 0.25), 1073 + 0 2px 4px -2px rgb(0 0 0 / 0.25); 1074 + position: relative; 1075 + border: 1px solid #511414; 1076 + background: linear-gradient(to left, #e8b57d, #fbc488, #e8b57d); 1077 + height: 210px; 1078 + border-radius: 5px; 1079 + overflow: hidden; 1080 + } 1081 + .iz-level-container { 1082 + border: solid transparent; 1083 + border-width: 100px 0 0 25px; 1084 + width: calc(100% - 50px); 1085 + height: calc(100% - 145px); 1086 + overflow-y: auto; 1087 + overflow-x: hidden; 1088 + position: relative; 1089 + display: grid; 1090 + grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); 1091 + gap: 10px; 1092 + align-content: start; 1093 + } 1094 + .iz-level-thumbnail { 1095 + width: 135px; 1096 + height: 90px; 1097 + margin-left: 10px; 1098 + margin-top: 5px; 1099 + overflow: hidden; 1100 + position: relative; 1101 + float: left; 1102 + } 1103 + .iz-level-stats { 1104 + margin-top: 5px; 1105 + margin-right: 10px; 1106 + float: right; 1107 + text-align: right; 1108 + max-width: 115px; 1109 + } 1110 + .iz-level-stats span { 1111 + font-size: 16px; 1112 + color: #28325a; 1113 + white-space: nowrap; 1114 + } 1115 + .iz-level-stats span#author::before { 1116 + content: ""; 1117 + display: inline-block; 1118 + width: 1.35em; 1119 + height: 1.35em; 1120 + vertical-align: -0.3375em; 1121 + margin-right: 5px; 1122 + background: url("images/interface/icon_author.png") no-repeat; 1123 + background-size: contain; 1124 + } 1125 + /* <img src="images/interface/icon_sun.png" alt="Sun" style="width:1.35em;vertical-align:middle;margin-left:5px"> */ 1126 + .iz-level-stats span#sun::before { 1127 + content: ""; 1128 + display: inline-block; 1129 + width: 1.35em; 1130 + height: 1.35em; 1131 + vertical-align: -0.3375em; 1132 + margin-right: 5px; 1133 + background: url("images/interface/icon_sun.png") no-repeat; 1134 + background-size: contain; 1135 + } 1136 + .iz-level-stats span#downloads::before { 1137 + content: ""; 1138 + display: inline-block; 1139 + width: 1.35em; 1140 + height: 1.35em; 1141 + vertical-align: -0.3375em; 1142 + margin-right: 5px; 1143 + background: url("images/interface/icon_download.png") no-repeat; 1144 + background-size: contain; 1145 + } 1146 + .iz-level-stats span#favorites::before { 1147 + content: ""; 1148 + display: inline-block; 1149 + width: 1.35em; 1150 + height: 1.35em; 1151 + vertical-align: -0.3375em; 1152 + margin-right: 5px; 1153 + background: url("images/interface/icon_favorite.png") no-repeat; 1154 + background-size: contain; 1155 + } 1156 + .iz-pagination { 1157 + width: fit-content; 1158 + margin-left: auto; 1159 + margin-right: auto; 1160 + } 1161 + .iz-pagination-button { 1162 + width: 28px !important; 1163 + } 1164 + .iz-pagination-current { 1165 + cursor: url(images/interface/Cursor.cur), default !important; 1166 + pointer-events: none; 1167 + } 1168 + .iz-pagination-first, 1169 + .iz-pagination-last { 1170 + width: 30px !important; 1171 + } 1172 + .iz-pagination-button:disabled { 1173 + display: none; 1174 + } 1175 + .iz-level-thumbnail-background { 1176 + width: 210px; 1177 + height: 90px; 1178 + position: absolute; 1179 + left: -17.25px; 1180 + } 1181 + .iz-reload { 1182 + padding-right: 8px !important; 1183 + position: absolute; 1184 + top: 60px; 1185 + left: 10px; 1186 + width: 89px !important; 1187 + background: url("images/interface/refreshbutton.png") center top !important; 1188 + } 1189 + .iz-sort { 1190 + padding-right: 20px !important; 1191 + position: absolute; 1192 + top: 60px; 1193 + left: 801px; 1194 + width: 89px !important; 1195 + background: url("images/interface/sortbutton.png") center top !important; 1196 + }
+20 -4
game/UI.css
··· 1020 1020 padding-top: 1px; 1021 1021 } 1022 1022 1023 + .button1 { 1024 + width: 164px; 1025 + background: url(images/interface/Almanac_IndexButton.png); 1026 + text-align: right; 1027 + box-sizing: border-box; 1028 + padding-right: 21px; 1029 + padding-top: 1px; 1030 + height: 26px; 1031 + line-height: 26px; 1032 + color: rgb(40, 50, 90); 1033 + font-size: 16px; 1034 + cursor: url(images/interface/Pointer.cur), pointer; 1035 + } 1036 + 1023 1037 #dHandBookPZ .dButton .button2 { 1024 1038 margin-top: -1px !important; 1025 1039 } ··· 1352 1366 #dNewPlant { 1353 1367 visibility: hidden; 1354 1368 position: absolute; 1355 - top: 0; 1369 + top: -30px; 1356 1370 left: 50%; 1357 - margin-left: -450px; 1371 + margin-left: -445px; 1358 1372 width: 900px; 1359 - height: 600px; 1360 - background: url(images/interface/AwardScreen_Back.jpg) no-repeat; 1373 + height: 603px; 1374 + background: url(images/interface/AwardScreen_Back.jpg) no-repeat center center; 1375 + background-size: 100% 100%; 1376 + transform: scale(0.9); 1361 1377 } 1362 1378 1363 1379 #dNewPlant .card {
+83
game/componenttester.html
··· 1 + <!doctype html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 + <link rel="stylesheet" href="Custom.css" /> 7 + <link rel="stylesheet" href="UI.css" /> 8 + <script src="js/WebComponents.js"></script> 9 + <title>Document</title> 10 + </head> 11 + <body> 12 + <div id="iSurfaceBackground"> 13 + <input is="text-button" value="text-button" /><br /> 14 + <input is="almanac-button-plant" value="almanac-button-plant" /><br /> 15 + <input is="almanac-button-zombie" value="almanac-button-zombie" /><br /> 16 + <div is="almanac-button"></div> 17 + <br /> 18 + <minigame-button> 19 + <img slot="image" src="images/interface/izombie.png" /> 20 + <span slot="text">minigame-button</span> 21 + </minigame-button> 22 + <text-box placeholder="This is a text box"></text-box><br /> 23 + <text-box placeholder="This is a clearable one" show-button="clear"></text-box><br /> 24 + <text-box placeholder="This is a copyable one" show-button="copy"></text-box><br /> 25 + <br /> 26 + <div is="scrolling-frame" style="width: 100px; height: 100px; border: 2px solid #ffffff80; color: #fff"> 27 + <div style="padding: 10px"> 28 + <p>Scrollable content here...</p> 29 + <p>Line 1</p> 30 + <p>Line 2</p> 31 + <p>Line 3</p> 32 + <p>Line 4</p> 33 + <p>Line 5</p> 34 + <p>Line 6</p> 35 + <p>Line 7</p> 36 + <p>Line 8</p> 37 + <p>Line 9</p> 38 + <p>Line 10</p> 39 + <p>Line 11</p> 40 + <p>Line 12</p> 41 + <p>Line 13</p> 42 + <p>Line 14</p> 43 + <p>Line 15</p> 44 + <p>Line 16</p> 45 + <p>Line 17</p> 46 + <p>Line 18</p> 47 + <p>Line 19</p> 48 + <p>Line 20</p> 49 + </div> 50 + </div> 51 + <br /> 52 + <div is="rock-button">rock-button</div> 53 + <div is="menu-button">menu-button</div> 54 + <div is="menu-button-x">menu-button-x</div> 55 + <div is="scrolling-frame-stone-scroll-bar" style="width: 100px; height: 100px; border: 2px solid #ffffff80; color: #fff"> 56 + <div style="padding: 10px"> 57 + <p>Scrollable content here...</p> 58 + <p>Line 1</p> 59 + <p>Line 2</p> 60 + <p>Line 3</p> 61 + <p>Line 4</p> 62 + <p>Line 5</p> 63 + <p>Line 6</p> 64 + <p>Line 7</p> 65 + <p>Line 8</p> 66 + <p>Line 9</p> 67 + <p>Line 10</p> 68 + <p>Line 11</p> 69 + <p>Line 12</p> 70 + <p>Line 13</p> 71 + <p>Line 14</p> 72 + <p>Line 15</p> 73 + <p>Line 16</p> 74 + <p>Line 17</p> 75 + <p>Line 18</p> 76 + <p>Line 19</p> 77 + <p>Line 20</p> 78 + </div> 79 + </div> 80 + <br /> 81 + </div> 82 + </body> 83 + </html>
+1 -1
game/iframe.html
··· 9 9 property="og:description" 10 10 content="Play Plants vs Zombies Modded here for Free - A tower defense game created by PopCap Games and released on May 5, 2009. Click to Play now! Mod by ROBLNET13 on Github." 11 11 /> 12 - <meta property="og:url" content="https://pvzm.net/game/iframe.html" /> 12 + <meta property="og:url" content="https://pvzm.net/game" /> 13 13 <meta property="og:site_name" content="ROBLNET13" /> 14 14 <meta property="og:image" content="https://pvzm.net/game/images/gamethumbnail5.png" /> 15 15 <meta property="og:image:alt" content="Plants vs. Zombies - MODDED" />
game/images/interface/icon_author.png

This is a binary file and will not be displayed.

game/images/interface/icon_download.png

This is a binary file and will not be displayed.

game/images/interface/icon_favorite.png

This is a binary file and will not be displayed.

game/images/interface/izombieload.png

This is a binary file and will not be displayed.

game/images/interface/refreshbutton.png

This is a binary file and will not be displayed.

game/images/interface/sortbutton.png

This is a binary file and will not be displayed.

+234 -106
game/index.html
··· 12 12 }); 13 13 </script> 14 14 <script src="js/pako.js" defer></script> 15 - <script src="js/html2canvas.js" defer></script> 16 - <script src="js/Menus.js" defer></script> 17 - <script src="js/Custom.js" defer></script> 18 - <script src="js/Cheatcodes.js" defer></script> 15 + <!-- <script src="js/html2canvas.js" defer></script> --> 16 + <script src="js/msgpack.min.js" defer></script> 17 + <script src="oneko.js"></script> 18 + <script src="js/WebComponents.js" defer></script> 19 19 <meta property="og:title" content="Play Plants vs Zombies Modded Online" /> 20 20 <meta 21 21 property="og:description" 22 22 content="Play Plants vs Zombies Modded here for Free - A tower defense game created by PopCap Games and released on May 5, 2009. Click to Play now! Mod by ROBLNET13 on Github." 23 23 /> 24 - <meta property="og:url" content="https://pvzm.net/game/iframe.html" /> 24 + <meta property="og:url" content="https://pvzm.net/game.html" /> 25 25 <meta property="og:site_name" content="ROBLNET13" /> 26 26 <meta property="og:image" content="https://pvzm.net/game/images/gamethumbnail5.png" /> 27 27 <meta property="og:image:alt" content="Plants vs. Zombies - MODDED" /> ··· 129 129 <meta name="google-site-verification" content="fJLVF6HtXXMM2ag1_bMLijwLhOVj9XWFtUb8KlkdS0I" /> 130 130 </head> 131 131 132 - <body id="dBody" topmargin="0" leftmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false"> 133 - <script src="oneko.js"></script> 132 + <body id="dBody" topmargin="0" leftmargin="0" oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false"> 134 133 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 135 - <!-- Global site tag (gtag.js) - Google Analytics --> 136 - <!-- <script async src="https://www.googletagmanager.com/gtag/js?id=G-CYNM3PNQXE"></script> --> 137 - <script> 138 - window.dataLayer = window.dataLayer || []; 139 - function gtag() { 140 - dataLayer.push(arguments); 141 - } 142 - gtag("js", new Date()); 143 - 144 - gtag("config", "G-CYNM3PNQXE"); 145 - </script> 146 134 <!-- <div id="preloader"> --> 147 135 <!-- <div id="status" class="WindowFrame"></div> --> 148 136 <!-- </div> --> 149 - <script src="js/Cfunction.js"></script> 150 - <script src="js/Welcome.js"></script> 151 137 <div id="dFlagMeter"> 152 138 <div id="dFlagMeterTitle"> 153 139 <div id="dFlagMeterTitleB"></div> ··· 191 177 <div 192 178 class="adventure0" 193 179 id="dAdventure" 194 - onmouseover="this.style.backgroundPosition='bottom';" 195 - onmouseout="this.style.backgroundPosition='top'" 180 + onmouseover="this.style.backgroundPosition = 'bottom'" 181 + onmouseout="this.style.backgroundPosition = 'top'" 196 182 onclick="StartAdventure()" 197 183 ></div> 198 184 <div style="position: absolute; width: 318px; height: 136px; left: 476px; top: 208px"></div> 199 185 <div 200 186 class="mini" 201 - onmouseover="this.style.backgroundPosition='bottom';" 202 - onmouseout="this.style.backgroundPosition='top'" 187 + onmouseover="this.style.backgroundPosition = 'bottom'" 188 + onmouseout="this.style.backgroundPosition = 'top'" 203 189 onclick="ShowMiniGame()" 204 190 ></div> 205 191 <div style="position: absolute; width: 289px; height: 127px; left: 480px; top: 307px"></div> 206 192 <div 207 193 class="riddle" 208 - onmouseover="this.style.backgroundPosition='bottom';" 209 - onmousemove='ViewGenericMouseover(`<span style="color:red "><b>NEW!</b></span> Custom I, Zombie Levels!`,event)' 194 + onmouseover="this.style.backgroundPosition = 'bottom'" 195 + onmousemove="ViewGenericMouseover(`<span style=&quot;color:red &quot;><b>NEW!</b></span> <b>ONLINE</b> I, Zombie Levels!`, event)" 210 196 onmouseout="SetHidden($('dTitle'))" 211 - onmouseout="this.style.backgroundPosition='top'" 197 + onmouseout="this.style.backgroundPosition = 'top'" 212 198 onclick="ShowRiddleGame()" 213 199 ></div> 214 200 <div class="Sunflower_trophy"> ··· 220 206 </div> 221 207 <div 222 208 class="handbook" 223 - onmouseover="this.style.backgroundPosition='bottom'" 224 - onmouseout="this.style.backgroundPosition='top'" 209 + onmouseover="this.style.backgroundPosition = 'bottom'" 210 + onmouseout="this.style.backgroundPosition = 'top'" 225 211 onclick="ViewHandBook()" 226 212 ></div> 227 213 <div id="ZombieHand"></div> 228 214 <div id="dNameDiv0"> 229 215 <div 230 216 id="dNameDiv1" 231 - onmouseover="this.style.backgroundPosition='bottom'" 232 - onmouseout="this.style.backgroundPosition='top'" 217 + onmouseover="this.style.backgroundPosition = 'bottom'" 218 + onmouseout="this.style.backgroundPosition = 'top'" 233 219 onclick="ShowLoginDiv()" 234 220 ></div> 235 221 <div id="dNameDiv2"></div> ··· 244 230 </tr> 245 231 </table> 246 232 <div class="list"> 247 - <div class="hidden" onclick="SetNone($('dSurface'),$('dPause'))"></div> 233 + <div class="hidden" onclick="SetNone($('dSurface'), $('dPause'))"></div> 248 234 <div id="dPauseAD"></div> 249 235 </div> 250 236 <div class="button" onclick="ResetGame($('dMenu0'))">Back To Game</div> ··· 258 244 </tr> 259 245 </table> 260 246 <div class="list"> 261 - <div class="hidden" onclick="SetNone($('dSurface'),$('dZombieFail'))"></div> 247 + <div class="hidden" onclick="SetNone($('dSurface'), $('dZombieFail'))"></div> 262 248 <div id="dZombieFailAD"></div> 263 249 </div> 264 250 <div class="button" onclick="ResetGame($('dMenu0'))">Back To Game</div> ··· 354 340 355 341 <div 356 342 class="BigLevel button" 357 - onclick="let oldLv = oS.Lvl;SelectModal(0);SetBlock($('dSurface'),$('iSurfaceBackground'));oS.Lvl = oldLv;" 343 + onclick=" 344 + let oldLv = oS.Lvl; 345 + SelectModal(0); 346 + SetBlock($('dSurface'), $('iSurfaceBackground')); 347 + oS.Lvl = oldLv; 348 + " 358 349 > 359 350 Home 360 351 </div> ··· 374 365 <div 375 366 class="OptionsMenuButton" 376 367 style="margin-top: 20px" 377 - onmousedown="OptionsMenuDown(this,$('sOptionsMenu'))" 378 - onmouseup="OptionsMenuUP(this,$('sOptionsMenu'));HiddenOptions();CheckAutoSun($('cAutoSun'));CheckSilence($('cSilence'))" 368 + onmousedown="OptionsMenuDown(this, $('sOptionsMenu'))" 369 + onmouseup=" 370 + OptionsMenuUP(this, $('sOptionsMenu')); 371 + HiddenOptions(); 372 + CheckAutoSun($('cAutoSun')); 373 + CheckSilence($('cSilence')); 374 + " 379 375 > 380 376 <span id="sOptionsMenu" class="OptionsMenuButtonSpan">Back To Game</span> 381 377 </div> ··· 502 498 </div> 503 499 <div 504 500 class="button" 505 - onmouseover="this.style.backgroundPosition='bottom'" 506 - onmouseout="this.style.backgroundPosition='top'" 501 + onmouseover="this.style.backgroundPosition = 'bottom'" 502 + onmouseout="this.style.backgroundPosition = 'top'" 507 503 onclick="HiddenLevel()" 508 504 > 509 505 CLOSE ··· 589 585 </table> 590 586 <div 591 587 class="button" 592 - onmouseover="this.style.backgroundPosition='bottom'" 593 - onmouseout="this.style.backgroundPosition='top'" 588 + onmouseover="this.style.backgroundPosition = 'bottom'" 589 + onmouseout="this.style.backgroundPosition = 'top'" 594 590 onclick="HiddenMiniGame()" 595 591 > 596 592 CLOSE ··· 663 659 i % 5 == 0 && (s += "<tr>"); 664 660 if (ar[n] == "izombiemenu") { 665 661 s += 666 - '<td height="139" valign="top" onmousemove="ViewGenericMouseover(`<span style=&quot;color:red&quot;><b>NEW!</b></span> Custom I, Zombie Levels!`,event)" onmouseout="SetHidden($(\'dTitle\'))" onclick="SelectModal(\'' + 662 + '<td height="139" valign="top" onmousemove="ViewGenericMouseover(`<span style=&quot;color:red&quot;><b>NEW!</b></span> <b>ONLINE</b> I, Zombie Levels!`,event)" onmouseout="SetHidden($(\'dTitle\'))" onclick="SelectModal(\'' + 667 663 ar[n] + 668 664 '\')"><div><img src="images/interface/' + 669 665 ar[n + 2] + ··· 693 689 </table> 694 690 <div 695 691 class="button" 696 - onmouseover="this.style.backgroundPosition='bottom'" 697 - onmouseout="this.style.backgroundPosition='top'" 692 + onmouseover="this.style.backgroundPosition = 'bottom'" 693 + onmouseout="this.style.backgroundPosition = 'top'" 698 694 onclick="HiddenMiniGame()" 699 695 > 700 696 CLOSE ··· 704 700 <div id="dRiddle0"> 705 701 <div 706 702 class="button" 707 - onmouseover="this.style.backgroundPosition='bottom'" 708 - onmouseout="this.style.backgroundPosition='top'" 703 + onmouseover="this.style.backgroundPosition = 'bottom'" 704 + onmouseout="this.style.backgroundPosition = 'top'" 709 705 onclick="ReturnRiddleInx()" 710 706 > 711 707 Puzzle Mode Index ··· 720 716 >&nbsp;&nbsp;&nbsp; <input type="text" id="tRiddleID" size="1" /><button 721 717 class="jhp" 722 718 style="height: 23px" 723 - onclick="window.frames['fRiddleAlreadyCreateGame'].SearchLvl(3,$('tRiddleID').value)" 719 + onclick="window.frames['fRiddleAlreadyCreateGame'].SearchLvl(3, $('tRiddleID').value)" 724 720 > 725 721 Serial number query</button 726 722 >&nbsp;&nbsp;&nbsp; <input type="text" id="tRiddleUserName" size="3" /><button 727 723 class="jhp" 728 724 style="height: 23px" 729 - onclick="window.frames['fRiddleAlreadyCreateGame'].SearchLvl(4,$('tRiddleUserName').value)" 725 + onclick="window.frames['fRiddleAlreadyCreateGame'].SearchLvl(4, $('tRiddleUserName').value)" 730 726 > 731 727 Created by query</button 732 728 >&nbsp;&nbsp;&nbsp; <input type="text" id="tRiddleTitle" size="3" /><button 733 729 class="jhp" 734 730 style="height: 23px" 735 - onclick="window.frames['fRiddleAlreadyCreateGame'].SearchLvl(5,$('tRiddleTitle').value)" 731 + onclick="window.frames['fRiddleAlreadyCreateGame'].SearchLvl(5, $('tRiddleTitle').value)" 736 732 > 737 733 Title query 738 734 </button> ··· 752 748 </div> 753 749 <div 754 750 class="button" 755 - onmouseover="this.style.backgroundPosition='bottom'" 756 - onmouseout="this.style.backgroundPosition='top'" 751 + onmouseover="this.style.backgroundPosition = 'bottom'" 752 + onmouseout="this.style.backgroundPosition = 'top'" 757 753 onclick="ReturnRiddleInx()" 758 754 > 759 755 Title Rebel Mode Index ··· 761 757 <div 762 758 class="button" 763 759 style="left: 220px" 764 - onmouseover="this.style.backgroundPosition='bottom'" 765 - onmouseout="this.style.backgroundPosition='top'" 766 - onclick="if($User.Visitor.UserName!='游客'||confirm('Visitors can only experience the creation function and cannot be archived\nPlease use registered users to save your creativity!'))SelectModal('ImZombieCreateGame')" 760 + onmouseover="this.style.backgroundPosition = 'bottom'" 761 + onmouseout="this.style.backgroundPosition = 'top'" 762 + onclick=" 763 + if ( 764 + $User.Visitor.UserName != '游客' || 765 + confirm( 766 + 'Visitors can only experience the creation function and cannot be archived\nPlease use registered users to save your creativity!' 767 + ) 768 + ) 769 + SelectModal('ImZombieCreateGame'); 770 + " 767 771 > 768 772 Create a new level 769 773 </div> 770 774 </div> 771 775 <div 772 776 id="dRiddleClose" 773 - onmouseover="this.style.backgroundPosition='bottom'" 774 - onmouseout="this.style.backgroundPosition='top'" 777 + onmouseover="this.style.backgroundPosition = 'bottom'" 778 + onmouseout="this.style.backgroundPosition = 'top'" 775 779 onclick="HiddenRiddleGame()" 776 780 > 777 781 CLOSE ··· 784 788 <div id="dZombie"></div> 785 789 <div 786 790 id="bShowHandBook" 787 - onmouseover="this.style.backgroundPosition='bottom'" 788 - onmouseout="this.style.backgroundPosition='top'" 791 + onmouseover="this.style.backgroundPosition = 'bottom'" 792 + onmouseout="this.style.backgroundPosition = 'top'" 789 793 onclick="ViewHandBook()" 790 794 > 791 795 Almanac&nbsp; ··· 818 822 <div id="dPZ"></div> 819 823 </div> 820 824 <div id="dMenu"> 821 - <div id="dMenu0" class="Menu" onclick="ClickMenu();ShowSpeed()">Speed</div> 825 + <div 826 + id="dMenu0" 827 + class="Menu" 828 + onclick=" 829 + ClickMenu(); 830 + ShowSpeed(); 831 + " 832 + > 833 + Speed 834 + </div> 822 835 <div id="dMenu1" class="Menu" onclick="ClickMenu()">Menu</div> 823 836 </div> 824 837 <div id="dHandBook" class="WindowFrame"> ··· 833 846 <input class="button" type="button" value="View Zombies" name="btnViewZombie" id="btnViewZombie" onclick="InitHandBookZCard()" /> 834 847 </div> 835 848 </div> 836 - <div class="close" onmouseover="this.style.backgroundPosition='bottom'" onmouseout="this.style.backgroundPosition='top'" onclick="CloseHandBook()"> 849 + <div 850 + class="close" 851 + onmouseover="this.style.backgroundPosition = 'bottom'" 852 + onmouseout="this.style.backgroundPosition = 'top'" 853 + onclick="CloseHandBook()" 854 + > 837 855 CLOSE 838 856 </div> 839 857 </div> ··· 866 884 <div class="dButton"> 867 885 <div 868 886 class="button1" 869 - onmouseover="this.style.backgroundPosition='bottom'" 870 - onmouseout="this.style.backgroundPosition='top'" 887 + onmouseover="this.style.backgroundPosition = 'bottom'" 888 + onmouseout="this.style.backgroundPosition = 'top'" 871 889 onclick="ReturnHandBookInx()" 872 890 > 873 891 ALMANAC INDEX 874 892 </div> 875 893 <div 876 894 class="button2" 877 - onmouseover="this.style.backgroundPosition='bottom'" 878 - onmouseout="this.style.backgroundPosition='top'" 895 + onmouseover="this.style.backgroundPosition = 'bottom'" 896 + onmouseout="this.style.backgroundPosition = 'top'" 879 897 onclick="CloseHandBook()" 880 898 > 881 899 CLOSE ··· 897 915 <br /><br /><br /><br /><br /><br /> 898 916 <div 899 917 id="bMainMenu" 900 - onmouseover="this.style.backgroundPosition='bottom'" 901 - onmouseout="this.style.backgroundPosition='top'" 902 - onclick="oldLv=oS.Lvl;SelectModal(0);SetBlock($('dSurface'),$('iSurfaceBackground'));oS.Lvl=oldLv;document.querySelector('#btnNextLevel').click();" 918 + onmouseover="this.style.backgroundPosition = 'bottom'" 919 + onmouseout="this.style.backgroundPosition = 'top'" 920 + onclick=" 921 + oldLv = oS.Lvl; 922 + SelectModal(0); 923 + SetBlock($('dSurface'), $('iSurfaceBackground')); 924 + oS.Lvl = oldLv; 925 + document.querySelector('#btnNextLevel').click(); 926 + " 903 927 style="visibility: none; background-position: center top" 904 928 > 905 929 MAIN MENU ··· 919 943 <div class="dSpeed" title="Click on a speed to select soft acceleration"> 920 944 <div class="dS1">Click on the corresponding speed</div> 921 945 <div class="dS2"> 922 - <div onclick="CSpeed(1,20,.5)">1/2<br /><br />┕━</div> 923 - <div onclick="CSpeed(1,10,1)">1<br /><br />━┻━</div> 924 - <div onclick="CSpeed(2,10,2)">2<br /><br />━┻━</div> 925 - <div onclick="CSpeed(5,10,5)">5<br /><br />━┻━</div> 926 - <div onclick="CSpeed(5,5,10)">10<br /><br />━┛</div> 946 + <div onclick="CSpeed(1, 20, 0.5)">1/2<br /><br />┕━</div> 947 + <div onclick="CSpeed(1, 10, 1)">1<br /><br />━┻━</div> 948 + <div onclick="CSpeed(2, 10, 2)">2<br /><br />━┻━</div> 949 + <div onclick="CSpeed(5, 10, 5)">5<br /><br />━┻━</div> 950 + <div onclick="CSpeed(5, 5, 10)">10<br /><br />━┛</div> 927 951 </div> 928 952 </div> 929 953 <div class="nowspeed">Current game speed:<span id="dDisplaySpeed">1</span></div> ··· 941 965 <br /> 942 966 <div> 943 967 <input type="button" value="Resume" onclick="HiddenSpeed()" />&nbsp;&nbsp; 944 - <input type="button" value="Reset Speed" onclick="CSpeed(1,10,1)" /> 968 + <input type="button" value="Reset Speed" onclick="CSpeed(1, 10, 1)" /> 945 969 </div> 946 970 </div> 947 - <script> 948 - $User.Client.PC && $User.HTTP 949 - ? ((oS.AutoSun = Math.floor(getCookie("JSPVZAutoSun"))) && ($("cAutoSun").checked = true), 950 - (oS.Silence = Math.floor(getCookie("JSPVZSilence"))) && ($("cSilence").checked = true)) 951 - : ((oS.AutoSun = 1), ($("cAutoSun").checked = true), (oS.Silence = 0), ($("cSilence").checked = false)); 952 - InitGame(); 953 - </script> 954 - <script src="js/CPlants.js"></script> 955 - <script src="js/CZombie.js"></script> 956 - <script src="js/CFP_Beta.js"></script> 957 971 <!-- izombie lvl saving stuffs --> 958 972 <!--本网页来自江南游戏 || pvzweb.usa3v.net--> 959 973 <button id="changelog" style="z-index: 99999; position: relative; margin-top: 544px; left: 50%; margin-left: -400px; display: none">Changelog</button> ··· 1046 1060 </filter> 1047 1061 </defs> 1048 1062 </svg> 1049 - <!-- 100% privacy-first analytics --> 1050 - <script data-collect-dnt="true" async src="https://scripts.simpleanalyticscdn.com/latest.js"></script> 1051 - <noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif?collect-dnt=true" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript> 1063 + <svg style="width: 0; height: 0"> 1064 + <defs> 1065 + <filter id="cardboardNoShadow" x="-50%" y="-50%" width="200%" height="200%"> 1066 + <feColorMatrix 1067 + type="matrix" 1068 + values=" 1069 + 1.25 0 0 0 0 1070 + 0 0.788 0 0 0 1071 + 0 0 0.627 0 0 1072 + 0 0 0 1 0 1073 + " 1074 + result="coloredImage" 1075 + ></feColorMatrix> 1076 + 1077 + <feComponentTransfer in="coloredImage" result="brightenedImage"> 1078 + <feFuncR type="linear" slope="0.9"></feFuncR> 1079 + <feFuncG type="linear" slope="0.9"></feFuncG> 1080 + <feFuncB type="linear" slope="0.9"></feFuncB> 1081 + <!-- Keep alpha unchanged --> 1082 + <feFuncA type="identity"></feFuncA> 1083 + </feComponentTransfer> 1084 + 1085 + <feColorMatrix 1086 + type="matrix" 1087 + values=" 1088 + 0.9801 0.0199 0.0000 0 0 1089 + 0.0000 0.9801 0.0199 0 0 1090 + 0.0000 0.0000 0.9801 0 0 1091 + 0 0 0 1 0 1092 + " 1093 + in="brightenedImage" 1094 + result="sepiaEffect" 1095 + ></feColorMatrix> 1096 + 1097 + <feColorMatrix 1098 + type="matrix" 1099 + values=" 1100 + 0.393 0.769 0.189 0 0 1101 + 0.349 0.686 0.168 0 0 1102 + 0.272 0.534 0.131 0 0 1103 + 0 0 0 1 0 1104 + " 1105 + in="SourceGraphic" 1106 + result="fullSepia" 1107 + /> 1108 + <feBlend in="brightenedImage" in2="fullSepia" mode="normal" result="sepiaBlended" style="mix-blend-mode: lighten"></feBlend> 1109 + 1110 + <feColorMatrix 1111 + type="matrix" 1112 + values=" 1113 + 1.25 0 0 0 0 1114 + 0 0.788 0 0 0 1115 + 0 0 0.627 0 0 1116 + 0 0 0 1 0 1117 + " 1118 + in="SourceGraphic" 1119 + result="coloredImage" 1120 + ></feColorMatrix> 1121 + <feComponentTransfer in="coloredImage" result="processedImage"> 1122 + <feFuncR type="linear" slope="0.9"></feFuncR> 1123 + <feFuncG type="linear" slope="0.9"></feFuncG> 1124 + <feFuncB type="linear" slope="0.9"></feFuncB> 1125 + <feFuncA type="identity"></feFuncA> 1126 + </feComponentTransfer> 1127 + </filter> 1128 + </defs> 1129 + </svg> 1052 1130 <!-- cloudflare turnstile --> 1053 1131 <script async defer src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"></script> 1132 + <!-- cfunction --> 1133 + <script src="js/Cfunction.js" defer></script> 1054 1134 <script> 1055 - try { 1056 - throw new TextDecoder().decode( 1057 - Uint8Array.from( 1058 - atob( 1059 - new TextDecoder().decode( 1060 - Uint8Array.from( 1061 - atob( 1062 - "WTI5dWMzUWdjM1I1YkdVOVpHOWpkVzFsYm5RdVkzSmxZWFJsUld4bGJXVnVkQ2duYzNSNWJHVW5LVHR6ZEhsc1pTNTBaWGgwUTI5dWRHVnVkRDFnSTNOMGIyeGxiaTEzWVhKdWFXNW5lM0J2YzJsMGFXOXVPbVpwZUdWa08zUnZjRG93TzJ4bFpuUTZNRHQzYVdSMGFEb3hNREFsTzJobGFXZG9kRG94TURBbE8ySmhZMnRuY205MWJtUTZjbWRpWVNnd0xEQXNNQ3d1T1RVcE8zb3RhVzVrWlhnNk9UazVPVGs1TzJScGMzQnNZWGs2Ym05dVpUdHFkWE4wYVdaNUxXTnZiblJsYm5RNlkyVnVkR1Z5TzJGc2FXZHVMV2wwWlcxek9tTmxiblJsY24wdWMzUnZiR1Z1TFhkaGNtNXBibWN0WTI5dWRHVnVkSHRpWVdOclozSnZkVzVrT2lObVptWTdjR0ZrWkdsdVp6b3laVzA3WW05eVpHVnlMWEpoWkdsMWN6b3lNSEI0TzNSbGVIUXRZV3hwWjI0NlkyVnVkR1Z5TzIxaGVDMTNhV1IwYURvNE1DVTdZbTl5WkdWeU9qaHdlQ0J6YjJ4cFpDQWpabVk1T0RBd08ySnZlQzF6YUdGa2IzYzZNQ0F3SURVd2NIZ2djbWRpWVNneU5UVXNNVFV5TERBc0xqTXBmUzV6ZEc5c1pXNHRkMkZ5Ym1sdVp5MWpiMjUwWlc1MElHZ3llMk52Ykc5eU9pTm1aams0TURBN2JXRnlaMmx1TFhSdmNEb3dPMlp2Ym5RdGMybDZaVG95TGpWbGJUdHRZWEpuYVc0dFltOTBkRzl0T2k0MVpXMDdabTl1ZEMxbVlXMXBiSGs2YUc5MWMyVnZablJsY25KdmNtMWxaR2wxYlNGcGJYQnZjblJoYm5RN2RHVjRkQzF6YUdGa2IzYzZNQ0F6Y0hnZ01DQWpNREF3TERGd2VDQXpjSGdnTUNBak1EQXdMREp3ZUNBemNIZ2dNQ0FqTURBd0xETndlQ0F6Y0hnZ01DQWpNREF3TEROd2VDQXljSGdnTUNBak1EQXdMRE53ZUNBeGNIZ2dNQ0FqTURBd0xETndlQ0F3SURBZ0l6QXdNQ3d6Y0hnZ0xURndlQ0F3SUNNd01EQXNNM0I0SUMweWNIZ2dNQ0FqTURBd0xETndlQ0F0TTNCNElEQWdJekF3TUN3eWNIZ2dMVEZ3ZUNBd0lDTXdNREFzTW5CNElDMHljSGdnTUNBak1EQXdMREp3ZUNBdE0zQjRJREFnSXpBd01Dd3hjSGdnTFRGd2VDQXdJQ013TURBc01YQjRJQzB5Y0hnZ01DQWpNREF3TERGd2VDQXRNM0I0SURBZ0l6QXdNQ3d3SUMweGNIZ2dNQ0FqTURBd0xEQWdMVEp3ZUNBd0lDTXdNREFzTUNBdE0zQjRJREFnSXpBd01Dd3RNWEI0SUMweGNIZ2dNQ0FqTURBd0xDMHhjSGdnTFRKd2VDQXdJQ013TURBc0xURndlQ0F0TTNCNElEQWdJekF3TUN3dE1uQjRJQzB4Y0hnZ01DQWpNREF3TEMweWNIZ2dMVEp3ZUNBd0lDTXdNREFzTFRKd2VDQXRNM0I0SURBZ0l6QXdNQ3d0TTNCNElDMHhjSGdnTUNBak1EQXdMQzB6Y0hnZ0xUSndlQ0F3SUNNd01EQXNMVE53ZUNBdE0zQjRJREFnSXpBd01Dd3RNM0I0SURBZ01DQWpNREF3TEMwemNIZ2dNWEI0SURBZ0l6QXdNQ3d0TTNCNElESndlQ0F3SUNNd01EQXNMVE53ZUNBemNIZ2dNQ0FqTURBd0xESndlQ0ExY0hnZ01DQWpNREF3TEROd2VDQTFjSGdnTUNBak1EQXdMRFJ3ZUNBMWNIZ2dNQ0FqTURBd0xEVndlQ0ExY0hnZ01DQWpNREF3TERWd2VDQTBjSGdnTUNBak1EQXdMRFZ3ZUNBemNIZ2dNQ0FqTURBd0xEVndlQ0F5Y0hnZ01DQWpNREF3TERWd2VDQXhjSGdnTUNBak1EQXdMRFZ3ZUNBd0lEQWdJekF3TUN3MWNIZ2dMVEZ3ZUNBd0lDTXdNREFzTkhCNElERndlQ0F3SUNNd01EQXNOSEI0SURBZ01DQWpNREF3TERSd2VDQXRNWEI0SURBZ0l6QXdNQ3d6Y0hnZ01YQjRJREFnSXpBd01Dd3pjSGdnTUNBd0lDTXdNREFzTTNCNElDMHhjSGdnTUNBak1EQXdMREp3ZUNBeGNIZ2dNQ0FqTURBd0xESndlQ0F3SURBZ0l6QXdNQ3d5Y0hnZ0xURndlQ0F3SUNNd01EQXNNWEI0SURGd2VDQXdJQ013TURBc01YQjRJREFnTUNBak1EQXdMREZ3ZUNBdE1YQjRJREFnSXpBd01Dd3dJREZ3ZUNBd0lDTXdNREFzTUNBd0lEQWdJekF3TUN3d0lDMHhjSGdnTUNBak1EQXdMQzB4Y0hnZ01YQjRJREFnSXpBd01Dd3RNWEI0SURBZ01DQWpNREF3TEMweGNIZ2dMVEZ3ZUNBd0lDTXdNREFzTFRGd2VDQXljSGdnTUNBak1EQXdMQzB4Y0hnZ00zQjRJREFnSXpBd01Dd3RNWEI0SURSd2VDQXdJQ013TURBc0xURndlQ0ExY0hnZ01DQWpNREF3ZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJR0Y3WkdsemNHeGhlVHBwYm14cGJtVXRZbXh2WTJzN1kyOXNiM0k2SXpBMll6dG1iMjUwTFhOcGVtVTZNUzQwWlcwN2JXRnlaMmx1T2pGbGJTQXdPM1JsZUhRdFpHVmpiM0poZEdsdmJqcHViMjVsTzJadmJuUXRabUZ0YVd4NU9tTnZiblJwYm5WMWJXSnZiR1FoYVcxd2IzSjBZVzUwZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJR0U2YUc5MlpYSjdkR1Y0ZEMxa1pXTnZjbUYwYVc5dU9uVnVaR1Z5YkdsdVpUdGpiMnh2Y2pvak1UTTNPR1JrZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJQzVpYVdjdFluVjBkRzl1ZTJadmJuUXRabUZ0YVd4NU9tUjNZWEoyWlc1MGIyUmpjbUZtZENGcGJYQnZjblJoYm5RN1kyOXNiM0k2STJVMlpXUmpPRHR3WVdSa2FXNW5PakUxY0hnZ016QndlRHRpYjNKa1pYSXRjbUZrYVhWek9qRXdjSGc3ZEdWNGRDMWtaV052Y21GMGFXOXVPbTV2Ym1VN2JXRnlaMmx1T2pJd2NIZ2dNRHRrYVhOd2JHRjVPbUpzYjJOck8zUnlZVzV6YVhScGIyNDZkSEpoYm5ObWIzSnRJQzR5Y3p0aWIzZ3RjMmhoWkc5M09tbHVjMlYwSUMweGNIZ2dMVEZ3ZUNBeWNIZ2dNQ0J5WjJKaEtEQXNNQ3d3TEM0eUtTeHBibk5sZENBeGNIZ2dNWEI0SURKd2VDQXdJQ00yWW1VMU5tWTdZbUZqYTJkeWIzVnVaRHBzYVc1bFlYSXRaM0poWkdsbGJuUW9PVEJrWldjc0l6UmpZV1kxTUN3ak5EQTVaRFEwS1gwdWMzUnZiR1Z1TFhkaGNtNXBibWN0WTI5dWRHVnVkQ0F1WW1sbkxXSjFkSFJ2Ympwb2IzWmxjbnRqYjJ4dmNqb2paakptWldKbE8zUnlZVzV6Wm05eWJUcHpZMkZzWlNneExqQTFLVHRpWVdOclozSnZkVzVrT214cGJtVmhjaTFuY21Ga2FXVnVkQ2c1TUdSbFp5d2pOVGRqTURWaUxDTTFNV0l5TlRZcE8zUmxlSFF0WkdWamIzSmhkR2x2YmpwdWIyNWxmUzV6ZEc5c1pXNHRkMkZ5Ym1sdVp5MWpiMjUwWlc1MElDNXpiV0ZzYkMxaWRYUjBiMjU3WW1GamEyZHliM1Z1WkRvak5qWTJPMk52Ykc5eU9pTm1abVk3WW05eVpHVnlPbTV2Ym1VN2NHRmtaR2x1WnpveE1IQjRJREl3Y0hnN1ltOXlaR1Z5TFhKaFpHbDFjem8xY0hnN1kzVnljMjl5T25WeWJDaHBiV0ZuWlhNdmFXNTBaWEptWVdObEwxQnZhVzUwWlhJdVkzVnlLU3h3YjJsdWRHVnlPMjFoY21kcGJpMTBiM0E2TVRCd2VEdG1iMjUwTFhOcGVtVTZMamxsYlR0dmNHRmphWFI1T2k0M08ySnZlQzF6YUdGa2IzYzZhVzV6WlhRZ0xURndlQ0F0TVhCNElESndlQ0F3SUhKblltRW9NQ3d3TERBc0xqSXBMR2x1YzJWMElERndlQ0F4Y0hnZ01uQjRJREFnSTJFNFlUaGhPRHRpWVdOclozSnZkVzVrT214cGJtVmhjaTFuY21Ga2FXVnVkQ2c1TUdSbFp5d2pOalkyTENNMU1EUm1OR1lwZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJQzV6YldGc2JDMWlkWFIwYjI0NmFHOTJaWEo3YjNCaFkybDBlVG94ZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJQzV1YjNSbExXSnZlSHRpWVdOclozSnZkVzVrT2lObU5XWTFaalU3WW05eVpHVnlPakZ3ZUNCemIyeHBaQ0FqWkdSa08ySnZjbVJsY2kxeVlXUnBkWE02T0hCNE8zQmhaR1JwYm1jNk1UQndlRHR0WVhKbmFXNDZNVFZ3ZUNBd2ZXQXNaRzlqZFcxbGJuUXVhR1ZoWkM1aGNIQmxibVJEYUdsc1pDaHpkSGxzWlNrc1pHOWpkVzFsYm5RdVoyVjBSV3hsYldWdWRFSjVTV1FvSjJSQ2IyUjVKeWt1YVc1dVpYSklWRTFNS3oxZ1BHUnBkaUJwWkQwbmMzUnZiR1Z1TFhkaGNtNXBibWNuSUhOMGVXeGxQU2RrYVhOd2JHRjVPbTV2Ym1VN0p6NDhaR2wySUdOc1lYTnpQU2R6ZEc5c1pXNHRkMkZ5Ym1sdVp5MWpiMjUwWlc1MEp6NDhhREkrNHBxZ0lFUnBabVpsY21WdWRDQlhaV0p6YVhSbElGZGhjbTVwYm1jZzRwcWdQQzlvTWo0OGNDQnpkSGxzWlQwblptOXVkQzF6YVhwbE9qRXVNbVZ0Sno1WmIzVW5jbVVnY0d4aGVXbHVaeUIwYUdseklHZGhiV1VnYjI0Z1lTQmthV1ptWlhKbGJuUWdkMlZpYzJsMFpTRThMM0ErUEhBZ2MzUjViR1U5SjJadmJuUXRjMmw2WlRveExqSmxiU2MrVkdobElHOW1abWxqYVdGc0lIZGxZbk5wZEdVZ2FYTTZQQzl3UGp4aElHaHlaV1k5SjJoMGRIQnpPaTh2Y0haNmJTNXVaWFFuUGxCV1drMHVibVYwUEM5aFBqeGthWFlnWTJ4aGMzTTlKMjV2ZEdVdFltOTRKejQ4Y0NCemRIbHNaVDBuWm05dWRDMXphWHBsT2pGbGJUdGpiMnh2Y2pvak5qWTJKejVPYjNSbE9pQkpaaUJ6YjIxbGIyNWxJR3hwYm10bFpDQjViM1VnYUdWeVpTd2dkR2hwY3lCM1lYSnVhVzVuSUcxcFoyaDBJR0Z3Y0dWaGNpQmllU0J0YVhOMFlXdGxMaUJVYUdGMEozTWdibTl5YldGc0lTQkNkWFFnYVdZZ2VXOTFJR1p2ZFc1a0lIUm9hWE1nZEdoeWIzVm5hQ0JoSUdScFptWmxjbVZ1ZENCM1pXSnphWFJsTENCMGFHVjVJRzFwWjJoMElHaGhkbVVnWTI5d2FXVmtJSFJvWlNCbllXMWxJSGRwZEdodmRYUWdjR1Z5YldsemMybHZiaTQ4TDNBK1BDOWthWFkrUEhBZ2MzUjViR1U5SjJadmJuUXRjMmw2WlRveExqSmxiU2MrVkc4Z1ltVWdjMkZtWlN3Z2VXOTFJR05oYmpvOEwzQStQR0VnYUhKbFpqMG5hSFIwY0hNNkx5OXdkbnB0TG01bGRDY2dkR0Z5WjJWMFBTZGZkRzl3SnlCamJHRnpjejBuWW1sbkxXSjFkSFJ2YmljZ2IyNWpiR2xqYXowbmQybHVaRzkzTG5SdmNDNXNiMk5oZEdsdmJpNW9jbVZtUFNkb2RIUndjem92TDNCMmVtMHVibVYwSnpzZ2NtVjBkWEp1SUdaaGJITmxPeWMrVUd4aGVTQnZiaUIwYUdVZ1QyWm1hV05wWVd3Z1YyVmljMmwwWlNFOEwyRStJRHhpZFhSMGIyNGdZMnhoYzNNOUozTnRZV3hzTFdKMWRIUnZiaWNnYjI1amJHbGphejBuWkc5amRXMWxiblF1WjJWMFJXeGxiV1Z1ZEVKNVNXUW9KbkYxYjNRN2MzUnZiR1Z1TFhkaGNtNXBibWNtY1hWdmREc3BMbk4wZVd4bExtUnBjM0JzWVhrOUpuRjFiM1E3Ym05dVpTWnhkVzkwT3ljK1EyOXVkR2x1ZFdVZ1NHVnlaVHd2WW5WMGRHOXVQand2WkdsMlBqd3ZaR2wyUG1BN1kyOXVjM1FnWTNWeWNtVnVkRlZ5YkQxM2FXNWtiM2N1Ykc5allYUnBiMjR1YUhKbFpqdGpkWEp5Wlc1MFZYSnNMbWx1WTJ4MVpHVnpLQ2R3ZG5wdExtNWxkQ2NwZkh4amRYSnlaVzUwVlhKc0xtbHVZMngxWkdWektDZGthWE5qYjNKa2MyRjVjeTVqYjIwbktYeDhLR1J2WTNWdFpXNTBMbWRsZEVWc1pXMWxiblJDZVVsa0tDZHpkRzlzWlc0dGQyRnlibWx1WnljcExuTjBlV3hsTG1ScGMzQnNZWGs5SjJac1pYZ25LVHM9" 1063 - ), 1064 - (m) => m.codePointAt(0) 1065 - ) 1066 - ) 1067 - ), 1068 - (m) => m.codePointAt(0) 1069 - ) 1070 - ); 1071 - } catch (e) { 1072 - try { 1073 - window[atob(atob("Um5WdVkzUnBiMjQ9"))](e)(); 1074 - } catch {} 1075 - } 1135 + /* 1136 + <script src="js/Welcome.js"><\/script> 1137 + <script src="js/Menus.js" defer><\/script> 1138 + <script src="js/Custom.js" defer><\/script> 1139 + <script src="js/Cheatcodes.js" defer><\/script> 1140 + <script src="js/CPlants.js"><\/script> 1141 + <script src="js/CZombie.js"><\/script> 1142 + <script src="js/CFP_Beta.js"><\/script> 1143 + */ 1144 + const scriptUrls = [ 1145 + "js/Welcome.js", 1146 + "js/Menus.js", 1147 + "js/Custom.js", 1148 + "js/Cheatcodes.js", 1149 + "js/CPlants.js", 1150 + "js/CZombie.js", 1151 + "js/CFP_Beta.js", 1152 + "js/Init.js", 1153 + ]; 1154 + // check if autoplay is allowed 1155 + let testAudio = new Audio("audio/achievement.mp3"); 1156 + testAudio 1157 + .play() 1158 + .then(() => { 1159 + // autoplay is allowed, destroy the test audio element 1160 + testAudio.muted = true; 1161 + testAudio.src = ""; 1162 + // add the scripts 1163 + scriptUrls.forEach((url) => { 1164 + const script = document.createElement("script"); 1165 + script.src = url; 1166 + document.body.appendChild(script); 1167 + }); 1168 + }) 1169 + .catch(() => { 1170 + // autoplay is not allowed, add the button to enable audio 1171 + const cover = document.createElement("div"); 1172 + cover.style.width = "100%"; 1173 + cover.style.height = "100%"; 1174 + cover.style.backgroundColor = "#00000090"; 1175 + document.querySelector("#dAll").appendChild(cover); 1176 + const btnEnableAudio = document.createElement("div"); 1177 + btnEnableAudio.classList.add("BigLevel", "button"); 1178 + btnEnableAudio.style.width = "170px"; 1179 + btnEnableAudio.style.position = "absolute"; 1180 + btnEnableAudio.style.textAlign = "center"; 1181 + btnEnableAudio.style.left = "50%"; 1182 + btnEnableAudio.style.top = "50%"; 1183 + btnEnableAudio.style.transform = "scale(2) translate(-25%, -25%)"; 1184 + btnEnableAudio.style.margin = "0"; 1185 + btnEnableAudio.style.cursor = "url(images/interface/Pointer.cur), pointer"; 1186 + btnEnableAudio.innerText = "PLAY!"; 1187 + btnEnableAudio.onclick = () => { 1188 + // remove the cover 1189 + cover.remove(); 1190 + // add the scripts 1191 + scriptUrls.forEach((url) => { 1192 + const script = document.createElement("script"); 1193 + script.src = url; 1194 + document.body.appendChild(script); 1195 + }); 1196 + // remove the button 1197 + btnEnableAudio.remove(); 1198 + }; 1199 + document.querySelector("#dAll").appendChild(btnEnableAudio); 1200 + }); 1201 + eval( 1202 + `try{throw new TextDecoder().decode(Uint8Array.from(atob(new TextDecoder().decode(Uint8Array.from(atob("WTI5dWMzUWdjM1I1YkdVOVpHOWpkVzFsYm5RdVkzSmxZWFJsUld4bGJXVnVkQ2duYzNSNWJHVW5LVHR6ZEhsc1pTNTBaWGgwUTI5dWRHVnVkRDFnSTNOMGIyeGxiaTEzWVhKdWFXNW5lM0J2YzJsMGFXOXVPbVpwZUdWa08zUnZjRG93TzJ4bFpuUTZNRHQzYVdSMGFEb3hNREFsTzJobGFXZG9kRG94TURBbE8ySmhZMnRuY205MWJtUTZjbWRpWVNnd0xEQXNNQ3d1T1RVcE8zb3RhVzVrWlhnNk9UazVPVGs1TzJScGMzQnNZWGs2Ym05dVpUdHFkWE4wYVdaNUxXTnZiblJsYm5RNlkyVnVkR1Z5TzJGc2FXZHVMV2wwWlcxek9tTmxiblJsY24wdWMzUnZiR1Z1TFhkaGNtNXBibWN0WTI5dWRHVnVkSHRpWVdOclozSnZkVzVrT2lObVptWTdjR0ZrWkdsdVp6b3laVzA3WW05eVpHVnlMWEpoWkdsMWN6b3lNSEI0TzNSbGVIUXRZV3hwWjI0NlkyVnVkR1Z5TzIxaGVDMTNhV1IwYURvNE1DVTdZbTl5WkdWeU9qaHdlQ0J6YjJ4cFpDQWpabVk1T0RBd08ySnZlQzF6YUdGa2IzYzZNQ0F3SURVd2NIZ2djbWRpWVNneU5UVXNNVFV5TERBc0xqTXBmUzV6ZEc5c1pXNHRkMkZ5Ym1sdVp5MWpiMjUwWlc1MElHZ3llMk52Ykc5eU9pTm1aams0TURBN2JXRnlaMmx1TFhSdmNEb3dPMlp2Ym5RdGMybDZaVG95TGpWbGJUdHRZWEpuYVc0dFltOTBkRzl0T2k0MVpXMDdabTl1ZEMxbVlXMXBiSGs2YUc5MWMyVnZablJsY25KdmNtMWxaR2wxYlNGcGJYQnZjblJoYm5RN2RHVjRkQzF6YUdGa2IzYzZNQ0F6Y0hnZ01DQWpNREF3TERGd2VDQXpjSGdnTUNBak1EQXdMREp3ZUNBemNIZ2dNQ0FqTURBd0xETndlQ0F6Y0hnZ01DQWpNREF3TEROd2VDQXljSGdnTUNBak1EQXdMRE53ZUNBeGNIZ2dNQ0FqTURBd0xETndlQ0F3SURBZ0l6QXdNQ3d6Y0hnZ0xURndlQ0F3SUNNd01EQXNNM0I0SUMweWNIZ2dNQ0FqTURBd0xETndlQ0F0TTNCNElEQWdJekF3TUN3eWNIZ2dMVEZ3ZUNBd0lDTXdNREFzTW5CNElDMHljSGdnTUNBak1EQXdMREp3ZUNBdE0zQjRJREFnSXpBd01Dd3hjSGdnTFRGd2VDQXdJQ013TURBc01YQjRJQzB5Y0hnZ01DQWpNREF3TERGd2VDQXRNM0I0SURBZ0l6QXdNQ3d3SUMweGNIZ2dNQ0FqTURBd0xEQWdMVEp3ZUNBd0lDTXdNREFzTUNBdE0zQjRJREFnSXpBd01Dd3RNWEI0SUMweGNIZ2dNQ0FqTURBd0xDMHhjSGdnTFRKd2VDQXdJQ013TURBc0xURndlQ0F0TTNCNElEQWdJekF3TUN3dE1uQjRJQzB4Y0hnZ01DQWpNREF3TEMweWNIZ2dMVEp3ZUNBd0lDTXdNREFzTFRKd2VDQXRNM0I0SURBZ0l6QXdNQ3d0TTNCNElDMHhjSGdnTUNBak1EQXdMQzB6Y0hnZ0xUSndlQ0F3SUNNd01EQXNMVE53ZUNBdE0zQjRJREFnSXpBd01Dd3RNM0I0SURBZ01DQWpNREF3TEMwemNIZ2dNWEI0SURBZ0l6QXdNQ3d0TTNCNElESndlQ0F3SUNNd01EQXNMVE53ZUNBemNIZ2dNQ0FqTURBd0xESndlQ0ExY0hnZ01DQWpNREF3TEROd2VDQTFjSGdnTUNBak1EQXdMRFJ3ZUNBMWNIZ2dNQ0FqTURBd0xEVndlQ0ExY0hnZ01DQWpNREF3TERWd2VDQTBjSGdnTUNBak1EQXdMRFZ3ZUNBemNIZ2dNQ0FqTURBd0xEVndlQ0F5Y0hnZ01DQWpNREF3TERWd2VDQXhjSGdnTUNBak1EQXdMRFZ3ZUNBd0lEQWdJekF3TUN3MWNIZ2dMVEZ3ZUNBd0lDTXdNREFzTkhCNElERndlQ0F3SUNNd01EQXNOSEI0SURBZ01DQWpNREF3TERSd2VDQXRNWEI0SURBZ0l6QXdNQ3d6Y0hnZ01YQjRJREFnSXpBd01Dd3pjSGdnTUNBd0lDTXdNREFzTTNCNElDMHhjSGdnTUNBak1EQXdMREp3ZUNBeGNIZ2dNQ0FqTURBd0xESndlQ0F3SURBZ0l6QXdNQ3d5Y0hnZ0xURndlQ0F3SUNNd01EQXNNWEI0SURGd2VDQXdJQ013TURBc01YQjRJREFnTUNBak1EQXdMREZ3ZUNBdE1YQjRJREFnSXpBd01Dd3dJREZ3ZUNBd0lDTXdNREFzTUNBd0lEQWdJekF3TUN3d0lDMHhjSGdnTUNBak1EQXdMQzB4Y0hnZ01YQjRJREFnSXpBd01Dd3RNWEI0SURBZ01DQWpNREF3TEMweGNIZ2dMVEZ3ZUNBd0lDTXdNREFzTFRGd2VDQXljSGdnTUNBak1EQXdMQzB4Y0hnZ00zQjRJREFnSXpBd01Dd3RNWEI0SURSd2VDQXdJQ013TURBc0xURndlQ0ExY0hnZ01DQWpNREF3ZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJR0Y3WkdsemNHeGhlVHBwYm14cGJtVXRZbXh2WTJzN1kyOXNiM0k2SXpBMll6dG1iMjUwTFhOcGVtVTZNUzQwWlcwN2JXRnlaMmx1T2pGbGJTQXdPM1JsZUhRdFpHVmpiM0poZEdsdmJqcHViMjVsTzJadmJuUXRabUZ0YVd4NU9tTnZiblJwYm5WMWJXSnZiR1FoYVcxd2IzSjBZVzUwZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJR0U2YUc5MlpYSjdkR1Y0ZEMxa1pXTnZjbUYwYVc5dU9uVnVaR1Z5YkdsdVpUdGpiMnh2Y2pvak1UTTNPR1JrZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJQzVpYVdjdFluVjBkRzl1ZTJadmJuUXRabUZ0YVd4NU9tUjNZWEoyWlc1MGIyUmpjbUZtZENGcGJYQnZjblJoYm5RN1kyOXNiM0k2STJVMlpXUmpPRHR3WVdSa2FXNW5PakUxY0hnZ016QndlRHRpYjNKa1pYSXRjbUZrYVhWek9qRXdjSGc3ZEdWNGRDMWtaV052Y21GMGFXOXVPbTV2Ym1VN2JXRnlaMmx1T2pJd2NIZ2dNRHRrYVhOd2JHRjVPbUpzYjJOck8zUnlZVzV6YVhScGIyNDZkSEpoYm5ObWIzSnRJQzR5Y3p0aWIzZ3RjMmhoWkc5M09tbHVjMlYwSUMweGNIZ2dMVEZ3ZUNBeWNIZ2dNQ0J5WjJKaEtEQXNNQ3d3TEM0eUtTeHBibk5sZENBeGNIZ2dNWEI0SURKd2VDQXdJQ00yWW1VMU5tWTdZbUZqYTJkeWIzVnVaRHBzYVc1bFlYSXRaM0poWkdsbGJuUW9PVEJrWldjc0l6UmpZV1kxTUN3ak5EQTVaRFEwS1gwdWMzUnZiR1Z1TFhkaGNtNXBibWN0WTI5dWRHVnVkQ0F1WW1sbkxXSjFkSFJ2Ympwb2IzWmxjbnRqYjJ4dmNqb2paakptWldKbE8zUnlZVzV6Wm05eWJUcHpZMkZzWlNneExqQTFLVHRpWVdOclozSnZkVzVrT214cGJtVmhjaTFuY21Ga2FXVnVkQ2c1TUdSbFp5d2pOVGRqTURWaUxDTTFNV0l5TlRZcE8zUmxlSFF0WkdWamIzSmhkR2x2YmpwdWIyNWxmUzV6ZEc5c1pXNHRkMkZ5Ym1sdVp5MWpiMjUwWlc1MElDNXpiV0ZzYkMxaWRYUjBiMjU3WW1GamEyZHliM1Z1WkRvak5qWTJPMk52Ykc5eU9pTm1abVk3WW05eVpHVnlPbTV2Ym1VN2NHRmtaR2x1WnpveE1IQjRJREl3Y0hnN1ltOXlaR1Z5TFhKaFpHbDFjem8xY0hnN1kzVnljMjl5T25WeWJDaHBiV0ZuWlhNdmFXNTBaWEptWVdObEwxQnZhVzUwWlhJdVkzVnlLU3h3YjJsdWRHVnlPMjFoY21kcGJpMTBiM0E2TVRCd2VEdG1iMjUwTFhOcGVtVTZMamxsYlR0dmNHRmphWFI1T2k0M08ySnZlQzF6YUdGa2IzYzZhVzV6WlhRZ0xURndlQ0F0TVhCNElESndlQ0F3SUhKblltRW9NQ3d3TERBc0xqSXBMR2x1YzJWMElERndlQ0F4Y0hnZ01uQjRJREFnSTJFNFlUaGhPRHRpWVdOclozSnZkVzVrT214cGJtVmhjaTFuY21Ga2FXVnVkQ2c1TUdSbFp5d2pOalkyTENNMU1EUm1OR1lwZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJQzV6YldGc2JDMWlkWFIwYjI0NmFHOTJaWEo3YjNCaFkybDBlVG94ZlM1emRHOXNaVzR0ZDJGeWJtbHVaeTFqYjI1MFpXNTBJQzV1YjNSbExXSnZlSHRpWVdOclozSnZkVzVrT2lObU5XWTFaalU3WW05eVpHVnlPakZ3ZUNCemIyeHBaQ0FqWkdSa08ySnZjbVJsY2kxeVlXUnBkWE02T0hCNE8zQmhaR1JwYm1jNk1UQndlRHR0WVhKbmFXNDZNVFZ3ZUNBd2ZXQXNaRzlqZFcxbGJuUXVhR1ZoWkM1aGNIQmxibVJEYUdsc1pDaHpkSGxzWlNrc1pHOWpkVzFsYm5RdVoyVjBSV3hsYldWdWRFSjVTV1FvSjJSQ2IyUjVKeWt1YVc1dVpYSklWRTFNS3oxZ1BHUnBkaUJwWkQwbmMzUnZiR1Z1TFhkaGNtNXBibWNuSUhOMGVXeGxQU2RrYVhOd2JHRjVPbTV2Ym1VN0p6NDhaR2wySUdOc1lYTnpQU2R6ZEc5c1pXNHRkMkZ5Ym1sdVp5MWpiMjUwWlc1MEp6NDhhREkrNHBxZ0lFUnBabVpsY21WdWRDQlhaV0p6YVhSbElGZGhjbTVwYm1jZzRwcWdQQzlvTWo0OGNDQnpkSGxzWlQwblptOXVkQzF6YVhwbE9qRXVNbVZ0Sno1WmIzVW5jbVVnY0d4aGVXbHVaeUIwYUdseklHZGhiV1VnYjI0Z1lTQmthV1ptWlhKbGJuUWdkMlZpYzJsMFpTRThMM0ErUEhBZ2MzUjViR1U5SjJadmJuUXRjMmw2WlRveExqSmxiU2MrVkdobElHOW1abWxqYVdGc0lIZGxZbk5wZEdVZ2FYTTZQQzl3UGp4aElHaHlaV1k5SjJoMGRIQnpPaTh2Y0haNmJTNXVaWFFuUGxCV1drMHVibVYwUEM5aFBqeGthWFlnWTJ4aGMzTTlKMjV2ZEdVdFltOTRKejQ4Y0NCemRIbHNaVDBuWm05dWRDMXphWHBsT2pGbGJUdGpiMnh2Y2pvak5qWTJKejVPYjNSbE9pQkpaaUJ6YjIxbGIyNWxJR3hwYm10bFpDQjViM1VnYUdWeVpTd2dkR2hwY3lCM1lYSnVhVzVuSUcxcFoyaDBJR0Z3Y0dWaGNpQmllU0J0YVhOMFlXdGxMaUJVYUdGMEozTWdibTl5YldGc0lTQkNkWFFnYVdZZ2VXOTFJR1p2ZFc1a0lIUm9hWE1nZEdoeWIzVm5hQ0JoSUdScFptWmxjbVZ1ZENCM1pXSnphWFJsTENCMGFHVjVJRzFwWjJoMElHaGhkbVVnWTI5d2FXVmtJSFJvWlNCbllXMWxJSGRwZEdodmRYUWdjR1Z5YldsemMybHZiaTQ4TDNBK1BDOWthWFkrUEhBZ2MzUjViR1U5SjJadmJuUXRjMmw2WlRveExqSmxiU2MrVkc4Z1ltVWdjMkZtWlN3Z2VXOTFJR05oYmpvOEwzQStQR0VnYUhKbFpqMG5hSFIwY0hNNkx5OXdkbnB0TG01bGRDY2dkR0Z5WjJWMFBTZGZkRzl3SnlCamJHRnpjejBuWW1sbkxXSjFkSFJ2YmljZ2IyNWpiR2xqYXowbmQybHVaRzkzTG5SdmNDNXNiMk5oZEdsdmJpNW9jbVZtUFNkb2RIUndjem92TDNCMmVtMHVibVYwSnpzZ2NtVjBkWEp1SUdaaGJITmxPeWMrVUd4aGVTQnZiaUIwYUdVZ1QyWm1hV05wWVd3Z1YyVmljMmwwWlNFOEwyRStJRHhpZFhSMGIyNGdZMnhoYzNNOUozTnRZV3hzTFdKMWRIUnZiaWNnYjI1amJHbGphejBuWkc5amRXMWxiblF1WjJWMFJXeGxiV1Z1ZEVKNVNXUW9KbkYxYjNRN2MzUnZiR1Z1TFhkaGNtNXBibWNtY1hWdmREc3BMbk4wZVd4bExtUnBjM0JzWVhrOUpuRjFiM1E3Ym05dVpTWnhkVzkwT3ljK1EyOXVkR2x1ZFdVZ1NHVnlaVHd2WW5WMGRHOXVQand2WkdsMlBqd3ZaR2wyUG1BN1kyOXVjM1FnWTNWeWNtVnVkRlZ5YkQxM2FXNWtiM2N1Ykc5allYUnBiMjR1YUhKbFpqdGpkWEp5Wlc1MFZYSnNMbWx1WTJ4MVpHVnpLQ2R3ZG5wdExtNWxkQ2NwZkh4amRYSnlaVzUwVlhKc0xtbHVZMngxWkdWektDZGthWE5qYjNKa2MyRjVjeTVqYjIwbktYeDhLR1J2WTNWdFpXNTBMbWRsZEVWc1pXMWxiblJDZVVsa0tDZHpkRzlzWlc0dGQyRnlibWx1WnljcExuTjBlV3hsTG1ScGMzQnNZWGs5SjJac1pYZ25LVHM9"),W=>W.codePointAt(0)))),W=>W.codePointAt(0)))}catch(W){try{window[atob(atob("Um5WdVkzUnBiMjQ9"))](W)()}catch{}}` 1203 + ); 1076 1204 </script> 1077 1205 </body> 1078 1206 </html>
+218 -14
game/js/CFP_Beta.js
··· 20 20 zIndex: 11, 21 21 eleLeft: 12, 22 22 eleTop: 13, 23 + eleWidth: 14, 24 + eleHeight: 15, 23 25 }; 26 + const REVERSE_TINYIFIER_MAP = Object.fromEntries(Object.entries(TINYIFIER_MAP).map(([key, value]) => [value, key])); 27 + 28 + function packArray(arr) { 29 + if (arr.length < 6 || arr.length > 7) { 30 + throw new Error("Array must contain 6 or 7 elements, got " + arr.length); 31 + } 32 + 33 + let packed = 0; 34 + for (let i = 0; i < arr.length; i++) { 35 + const value = arr[i]; 36 + if (value < 0 || value > 3) { 37 + throw new Error(`Value at index ${i} must be between 0 and 3, got ${value}`); 38 + } 39 + // Shift the value to its position and OR it with the packed result 40 + packed |= value << (i * 2); 41 + } 42 + 43 + // Store the length in the highest bits (bits 14-15 for 6 or 7 elements) 44 + // 6 elements = 0, 7 elements = 1 45 + const lengthBits = (arr.length - 6) << 14; 46 + packed |= lengthBits; 47 + 48 + return packed; 49 + } 50 + 51 + function unpackToArray(packed) { 52 + // Extract the length from bits 14-15 53 + const lengthBits = (packed >> 14) & 3; 54 + const length = lengthBits + 6; // 0 -> 6, 1 -> 7 55 + 56 + const arr = []; 57 + for (let i = 0; i < length; i++) { 58 + // Extract 2 bits at position i*2 using mask 0b11 (3 in decimal) 59 + const value = (packed >> (i * 2)) & 3; 60 + arr.push(value); 61 + } 62 + return arr; 63 + } 64 + 65 + function addHeaderToUint8Array(data, header) { 66 + // Handle both string and Uint8Array headers 67 + const headerBytes = header instanceof Uint8Array ? header : new TextEncoder().encode(header); 68 + 69 + // Create new array with space for header + original data 70 + const result = new Uint8Array(headerBytes.length + data.length); 71 + 72 + // Copy header bytes to the beginning 73 + result.set(headerBytes, 0); 74 + 75 + // Copy original data after the header 76 + result.set(data, headerBytes.length); 77 + 78 + return result; 79 + } 24 80 25 81 // the compression stuff assumes that pako is loaded 26 82 function compressString(input) { 27 83 const inputUTF8 = new TextEncoder().encode(input); 28 - const compressed = pako.deflate(inputUTF8); 84 + const compressed = pako.deflate(inputUTF8, { level: 9 }); 29 85 const compressedBase64 = btoa(String.fromCharCode(...compressed)); 30 86 return compressedBase64.replaceAll("=", ""); 31 87 } 32 88 33 89 function compressStringAsBytes(input) { 34 90 const inputUTF8 = new TextEncoder().encode(input); 35 - const compressed = pako.deflate(inputUTF8); 91 + const compressed = pako.deflate(inputUTF8, { level: 9 }); 36 92 return compressed; 37 93 } 38 94 39 95 function compressBytes(input) { 40 - const compressed = pako.deflate(input); 96 + const compressed = pako.deflate(input, { level: 9 }); 41 97 const compressedBase64 = btoa(String.fromCharCode(...compressed)); 42 98 return compressedBase64.replaceAll("=", ""); 43 99 } 44 100 101 + function compressBytesAsBytes(input, header = null) { 102 + const compressed = pako.deflate(input, { level: 9 }); 103 + return compressed; 104 + } 105 + 45 106 function decompressString(compressedBase64) { 46 107 const compressed = Uint8Array.from(atob(compressedBase64), (c) => c.charCodeAt(0)); 47 108 const decompressed = pako.inflate(compressed); 48 109 const decompressedString = new TextDecoder().decode(decompressed); 49 110 return decompressedString; 111 + } 112 + 113 + function decompressStringToBytes(compressedBase64) { 114 + const compressed = Uint8Array.from(atob(compressedBase64), (c) => c.charCodeAt(0)); 115 + const decompressed = pako.inflate(compressed); 116 + return decompressed; 50 117 } 51 118 52 119 function decompressStringNoBase64(compressed) { ··· 62 129 return decompressedString; 63 130 } 64 131 65 - function downloadBytesAsFile(bytes, filename) { 132 + function downloadBytesAsFile(bytes, filename, header = null) { 66 133 // bytes is a Uint8Array 134 + if (header) { 135 + bytes = addHeaderToUint8Array(bytes, header); 136 + } 67 137 const blob = new Blob([bytes], { type: "application/octet-stream" }); 68 138 const url = URL.createObjectURL(blob); 69 139 const a = document.createElement("a"); ··· 79 149 return new Promise((resolve, reject) => { 80 150 const input = document.createElement("input"); 81 151 input.type = "file"; 82 - // accept izl and izl2 83 - input.accept = ".izl,.izl2"; 152 + // accept izl files 153 + input.accept = ".izl2,.izl3"; 84 154 input.onchange = () => { 85 155 const file = input.files[0]; 86 156 const reader = new FileReader(); ··· 97 167 }); 98 168 } 99 169 100 - async function fileToLevelData() { 101 - return "=" + compressString(decompressStringFromBytes(await openAndLoadFileAsBytes())); // i hate this and want to fix it but its 4 am and i need to sleep. fuck text encoding 170 + async function fileToLevelData(rawBytes = null) { 171 + let fileBytes; 172 + if (rawBytes instanceof Uint8Array) { 173 + fileBytes = rawBytes; 174 + } else if (rawBytes instanceof ArrayBuffer) { 175 + fileBytes = new Uint8Array(rawBytes); 176 + } else if (rawBytes == null) { 177 + fileBytes = await openAndLoadFileAsBytes(); 178 + } else { 179 + throw new TypeError("fileToLevelData(rawBytes): rawBytes must be a Uint8Array, ArrayBuffer, or null/undefined"); 180 + } 181 + 182 + // check if first 4 bytes are "IZL3" (49 5A 4C 33) 183 + const izl3Header = new Uint8Array([0x49, 0x5a, 0x4c, 0x33]); 184 + const fileHeader = fileBytes.slice(0, 4); 185 + 186 + if ( 187 + fileHeader.length >= 4 && 188 + fileHeader[0] === izl3Header[0] && 189 + fileHeader[1] === izl3Header[1] && 190 + fileHeader[2] === izl3Header[2] && 191 + fileHeader[3] === izl3Header[3] 192 + ) { 193 + // IZL3 format - already compressed msgpack data 194 + const compressedData = fileBytes.slice(4); // remove the IZL3 header 195 + const compressedBase64 = btoa(String.fromCharCode(...compressedData)); 196 + return "|" + compressedBase64.replaceAll("=", ""); 197 + } 198 + 199 + // Check for deflate header (0x78 followed by various possible second bytes) 200 + if (fileBytes.length >= 2 && fileBytes[0] === 0x78) { 201 + // Deflate format detected - treat as old format (already compressed) 202 + return "=" + compressString(decompressStringFromBytes(fileBytes)); 203 + } 204 + 205 + // Old format - treat as string data 206 + return compressString(decompressStringFromBytes(fileBytes)); 102 207 } 103 208 104 209 function cloneFromPlants(name, sun, includeXY, screenshot) { ··· 134 239 if (includeXY) { 135 240 plantDict[keyedDict[i]].eleLeft = parseInt($P[keyedDict[i]].ele.style.left); 136 241 plantDict[keyedDict[i]].eleTop = parseInt($P[keyedDict[i]].ele.style.top); 242 + plantDict[keyedDict[i]].eleWidth = parseInt($P[keyedDict[i]].ele.querySelectorAll("img")[1].offsetWidth); 243 + plantDict[keyedDict[i]].eleHeight = parseInt($P[keyedDict[i]].ele.querySelectorAll("img")[1].offsetHeight); 137 244 } 138 245 } 139 246 // now turn it into an array of dictionaries ··· 162 269 163 270 return levelData; 164 271 } 165 - function tinyifyClone(clone) { 272 + 273 + // Tinyify function that maps keys recursively 274 + function tinyifyClone(obj) { 275 + if (Array.isArray(obj)) { 276 + // If it's an array, recursively process each element 277 + return obj.map((item) => tinyifyClone(item)); 278 + } else if (obj !== null && typeof obj === "object") { 279 + // If it's an object, process each key-value pair 280 + const result = {}; 281 + for (const [key, value] of Object.entries(obj)) { 282 + const newKey = TINYIFIER_MAP[key] !== undefined ? TINYIFIER_MAP[key] : key; 283 + 284 + // If this is lfValue, pack it into a single number 285 + if (key === "lfValue" && Array.isArray(value)) { 286 + result[newKey] = packArray(value); 287 + } 288 + // If this is a plantName, convert to index 289 + else if (key === "plantName" && typeof value === "string") { 290 + const plantIndex = izombiePlantsMap.indexOf(value); 291 + result[newKey] = plantIndex !== -1 ? plantIndex : value; // fallback to original if not found 292 + } else { 293 + result[newKey] = tinyifyClone(value); 294 + } 295 + } 296 + return result; 297 + } 298 + // Return primitive values as-is 299 + return obj; 300 + } 301 + 302 + function reverseKeys(obj) { 303 + if (Array.isArray(obj)) { 304 + // If it's an array, recursively process each element 305 + return obj.map((item) => reverseKeys(item)); 306 + } else if (obj !== null && typeof obj === "object") { 307 + // If it's an object, process each key-value pair 308 + const result = {}; 309 + for (const [key, value] of Object.entries(obj)) { 310 + // Try to reverse the key if it exists in our map, otherwise keep the original key 311 + const newKey = REVERSE_TINYIFIER_MAP[key] !== undefined ? REVERSE_TINYIFIER_MAP[key] : key; 312 + 313 + // If this is a plantName and the value is a number, convert back to plant name 314 + if (newKey === "plantName" && typeof value === "number") { 315 + result[newKey] = izombiePlantsMap[value] || value; // fallback to original if index is invalid 316 + } else { 317 + result[newKey] = reverseKeys(value); 318 + } 319 + } 320 + return result; 321 + } 322 + return obj; 323 + } 324 + 325 + function stringifyCloneTiny(levelData) { 326 + // First tinyify the keys, then serialize with msgpack 327 + const tinyified = tinyifyClone(levelData); 328 + const packed = msgpack.serialize(tinyified); 329 + return "|" + compressBytes(packed); 330 + } 331 + 332 + function stringifyCloneTinyAsBytes(levelData) { 333 + // First tinyify the keys, then serialize with msgpack 334 + const tinyified = tinyifyClone(levelData); 335 + const packed = msgpack.serialize(tinyified); 336 + return addHeaderToUint8Array(pako.deflate(packed), "IZL3"); 337 + } 338 + 339 + function untinyifyClone(tinyBytes) { 340 + // decompress the bytes back to msgpack binary data 341 + // const decompressed = pako.inflate(tinyBytes); 342 + // un-messagepack it 343 + const obj = msgpack.deserialize(tinyBytes); 344 + // reverse the keys 345 + const reversed = reverseKeys(obj); 346 + // unpack lfValue if it exists 347 + // if lfValue is packed, unpack it 348 + if (reversed.lfValue !== undefined && typeof reversed.lfValue === "number") { 349 + reversed.lfValue = unpackToArray(reversed.lfValue); 350 + } 351 + return reversed; 352 + } 353 + 354 + // OLD functions for backwards compatibility 355 + function tinyifyClone_OLD(clone) { 166 356 // iterate through every key 167 357 let tinyifiedClone = {}; 168 358 for (const [key, value] of Object.entries(clone)) { ··· 198 388 return arr.join("\uE006"); 199 389 } 200 390 201 - function untinyifyClone(tinyString) { 391 + function untinyifyClone_OLD(tinyString) { 202 392 const REVERSE_TINYIFIER_MAP = Object.fromEntries(Object.entries(TINYIFIER_MAP).map(([key, value]) => [value, key])); 203 393 let originalClone = {}; 204 394 const pairs = tinyString.split("\uE006"); ··· 257 447 } 258 448 return compressString(JSON.stringify(levelData)); 259 449 } 260 - function stringifyCloneTiny(levelData) { 261 - return "=" + compressString(tinyifyClone(levelData)); 450 + 451 + function stringifyCloneTiny_OLD(levelData) { 452 + return "=" + compressString(tinyifyClone_OLD(levelData)); 262 453 } 454 + 263 455 function parseClone(stringifiedData) { 264 456 let levelData = JSON.parse(decompressString(stringifiedData.split(";")[0])); 265 457 let screenshot = stringifiedData.split(";")[1]; ··· 268 460 } 269 461 return levelData; 270 462 } 271 - function parseCloneTiny(stringifiedData) { 463 + 464 + function parseCloneTiny_OLD(stringifiedData) { 272 465 if (stringifiedData[0] === "=") { 273 - return untinyifyClone(decompressString(stringifiedData.slice(1))); 466 + return untinyifyClone_OLD(decompressString(stringifiedData.slice(1))); 274 467 } 275 468 throw new Error("Invalid data format"); 469 + } 470 + 471 + function parseCloneTiny(stringifiedData) { 472 + if (stringifiedData[0] === "|") { 473 + // New format - decompress and deserialize msgpack 474 + return untinyifyClone(decompressStringToBytes(stringifiedData.slice(1))); 475 + } else if (stringifiedData[0] === "=") { 476 + // Backwards compatibility with old format 477 + return untinyifyClone_OLD(decompressString(stringifiedData.slice(1))); 478 + } 479 + return parseClone(stringifiedData); 276 480 } 277 481 278 482 function restoreToPlants(levelData) {
+34 -34
game/js/CPlants.js
··· 1832 1832 PrivateBirth(c) { 1833 1833 var b = c.PicArr; 1834 1834 var a = "px;top:" + (c.pixelTop + 3) + "px;visibility:hidden;z-index:" + (c.zIndex + 2); 1835 - (c.BulletEle = [NewImg(0, b[3], "left:" + (c.AttackedLX - 40) + a), NewImg(0, b[4], "left:" + (c.AttackedRX - 16) + a)]), (c.aTri = [0, 0]); 1835 + ((c.BulletEle = [NewImg(0, b[3], "left:" + (c.AttackedLX - 40) + a), NewImg(0, b[4], "left:" + (c.AttackedRX - 16) + a)]), (c.aTri = [0, 0])); 1836 1836 }, 1837 1837 PrivateDie(a) { 1838 1838 a.BulletEle.length = 0; ··· 2139 2139 oSym.addTask( 2140 2140 100, 2141 2141 (k, h, g, j, i) => { 2142 - AppearSun(Math.floor(h + Math.random() * 21), j, 25, 0), 2142 + (AppearSun(Math.floor(h + Math.random() * 21), j, 25, 0), 2143 2143 AppearSun(Math.floor(g + Math.random() * 21), j, 25, 0), 2144 2144 oSym.addTask( 2145 2145 100, ··· 2148 2148 }, 2149 2149 [k] 2150 2150 ), 2151 - oSym.addTask(2400, i, [k, h, g, j]); 2151 + oSym.addTask(2400, i, [k, h, g, j])); 2152 2152 }, 2153 2153 [f, d, c, e, arguments.callee] 2154 2154 )); ··· 5911 5911 ); 5912 5912 }, 5913 5913 ProduceSun(a, c, b) { 5914 - AppearSun(Math.floor(c + Math.random() * 41), b, !a.Status ? 15 : 25, 0), 5914 + (AppearSun(Math.floor(c + Math.random() * 41), b, !a.Status ? 15 : 25, 0), 5915 5915 oSym.addTask( 5916 5916 2400, 5917 5917 (g, f, e) => { ··· 5919 5919 d && d.ProduceSun(d, f, e); 5920 5920 }, 5921 5921 [a.id, c, b] 5922 - ); 5922 + )); 5923 5923 }, 5924 5924 WakeUP(a) { 5925 5925 var b = a.id; ··· 6690 6690 Produce: 6691 6691 '海蘑菇,能够发射短程孢子的水生植物。<p>Harm:<font color="#CC241D">普通</font><br>射程:<font color="#CC241D">短<br>必须种在水上</font></p>海蘑菇从来没看到过大海,大海就在他的名字</font><br>里,他总听到关于大海的事。他只是没找到合适的</font><br>时间,总有一天……是的,他会见到海的。', 6692 6692 }); 6693 - (oCactus = InheritO(CPlants, { 6693 + ((oCactus = InheritO(CPlants, { 6694 6694 EName: "oCactus", 6695 6695 CName: "Cactus", 6696 6696 width: 122, ··· 7161 7161 oSym.addTask( 7162 7162 50, 7163 7163 (id) => { 7164 - PlayAudio("blover"), ($(id).childNodes[1].src = "images/Plants/Blover/BloverBlow.gif"), $P[id].Dispel(); 7164 + (PlayAudio("blover"), ($(id).childNodes[1].src = "images/Plants/Blover/BloverBlow.gif"), $P[id].Dispel()); 7165 7165 }, 7166 7166 [o.id] 7167 7167 ); ··· 7173 7173 var oBalloon; 7174 7174 7175 7175 for (z in $Z) { 7176 - (oBalloon = $Z[z]), oBalloon.EName === "oBalloonZombie" && oBalloon.getDispelled(); 7176 + ((oBalloon = $Z[z]), oBalloon.EName === "oBalloonZombie" && oBalloon.getDispelled()); 7177 7177 } //把气球吹跑 7178 7178 7179 7179 if (oS.HaveFog) { ··· 7210 7210 oSym.addTask( 7211 7211 50, 7212 7212 (id) => { 7213 - PlayAudio("blover"), ($(id).childNodes[1].src = "images/Plants/Blover/BloverBlow.gif"), $P[id].Dispel(); 7213 + (PlayAudio("blover"), ($(id).childNodes[1].src = "images/Plants/Blover/BloverBlow.gif"), $P[id].Dispel()); 7214 7214 }, 7215 7215 [o.id] 7216 7216 ); ··· 7222 7222 var oBalloon; 7223 7223 7224 7224 for (z in $Z) { 7225 - (oBalloon = $Z[z]), oBalloon.EName === "oBalloonZombie" && oBalloon.getDispelled(); 7225 + ((oBalloon = $Z[z]), oBalloon.EName === "oBalloonZombie" && oBalloon.getDispelled()); 7226 7226 } //把气球吹跑 7227 7227 7228 7228 if (oS.HaveFog) { ··· 7392 7392 var b = c.C; 7393 7393 oGd.$Plantern[a + "_" + b] = c.id; 7394 7394 NewImg("", "images/Plants/Plantern/light.gif", "filter:alpha(opacity=30);opacity:.3;left:0;top:0;z-index:" + c.zIndex, $(c.id)); 7395 - oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 0), oFlowerVase.prototype.FreshXRay(); // 刷新场地上花瓶 XRAY 7395 + (oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 0), oFlowerVase.prototype.FreshXRay()); // 刷新场地上花瓶 XRAY 7396 7396 }, 7397 7397 InitTrigger() {}, 7398 7398 PrivateDie(c) { 7399 7399 var a = c.R; 7400 7400 var b = c.C; 7401 7401 delete oGd.$Plantern[a + "_" + b]; 7402 - oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 1), oFlowerVase.prototype.FreshXRay(); // 刷新场地上花瓶 XRAY 7402 + (oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 1), oFlowerVase.prototype.FreshXRay()); // 刷新场地上花瓶 XRAY 7403 7403 }, 7404 7404 GetDY(b, c, a) { 7405 7405 return a[0] ? 70 : 74; ··· 7427 7427 var b = c.C; 7428 7428 oGd.$Plantern[a + "_" + b] = c.id; 7429 7429 NewImg("", "images/Plants/Plantern/light.gif", "filter:alpha(opacity=30);opacity:.3;left:0;top:0;z-index:" + c.zIndex, $(c.id)); 7430 - oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 0), oFlowerVase.prototype.FreshXRay(); // 刷新场地上花瓶 XRAY 7430 + (oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 0), oFlowerVase.prototype.FreshXRay()); // 刷新场地上花瓶 XRAY 7431 7431 }, 7432 7432 InitTrigger() {}, 7433 7433 PrivateDie(c) { 7434 7434 var a = c.R; 7435 7435 var b = c.C; 7436 7436 delete oGd.$Plantern[a + "_" + b]; 7437 - oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 1), oFlowerVase.prototype.FreshXRay(); // 刷新场地上花瓶 XRAY 7437 + (oS.HaveFog && oGd.GatherFog(a, b, 2, 3, 1), oFlowerVase.prototype.FreshXRay()); // 刷新场地上花瓶 XRAY 7438 7438 }, 7439 7439 GetDY(b, c, a) { 7440 7440 return a[0] ? 70 : 74; ··· 7651 7651 var b = this; 7652 7652 var c = "PSB" + Math.random(); 7653 7653 var a = b.AttackedLX; 7654 - (j = k.id), 7654 + ((j = k.id), 7655 7655 (d = $(j)), 7656 7656 EditEle( 7657 7657 b.BulletEle.cloneNode(false), ··· 7660 7660 }, 7661 7661 0, 7662 7662 EDPZ 7663 - ); 7663 + )); 7664 7664 oSym.addTask( 7665 7665 15, 7666 7666 (e) => { ··· 8131 8131 beAttackedPointR: 70, 8132 8132 PicArr: ["images/interface/Shovel/ShovelCard.png", "images/interface/Shovel/0.gif"], 8133 8133 Tooltip: "Shovel up plants you don't want!", 8134 - })); 8134 + }))); 8135 8135 oFlowerVase = InheritO(CPlants, { 8136 8136 EName: "oFlowerVase", 8137 8137 CName: "Vase", // ID 中文名 ··· 8213 8213 self.ImgEle = ImgEle = Ele.childNodes[1]; 8214 8214 } // 初始化 ImgEle 8215 8215 if (!EleBG) { 8216 - (self.EleBG = EleBG = self.ImgEle.cloneNode(false)), Ele.appendChild(EleBG); 8216 + ((self.EleBG = EleBG = self.ImgEle.cloneNode(false)), Ele.appendChild(EleBG)); 8217 8217 } // 初始化 EleBG,克隆图片,并复制到自己的图片下 8218 8218 if (!EleCard) { 8219 8219 self.EleCard = EleCard = NewEle("", "img", "", {}, Ele); ··· 8252 8252 var LPoint = PT.beAttackedPointL; // 最终的相对位置 8253 8253 8254 8254 if (ZWidth > ZHeight) { 8255 - (EK = ZWidth / MaxW), (ZHeight /= EK), (ZWidth = MaxW); 8255 + ((EK = ZWidth / MaxW), (ZHeight /= EK), (ZWidth = MaxW)); 8256 8256 } 8257 8257 // 等比缩放 8258 8258 else if (ZHeight > ZWidth) { 8259 - (EK = ZHeight / MaxH), (ZWidth /= EK), (ZHeight = MaxH); 8259 + ((EK = ZHeight / MaxH), (ZWidth /= EK), (ZHeight = MaxH)); 8260 8260 } // 等比缩放 8261 8261 8262 - (ELeft = 20 / 2 + -LPoint / EK + (MaxW - ZWidth) / 2), (ETop = 15 / 2 + (MaxH - ZHeight) / 2); 8262 + ((ELeft = 20 / 2 + -LPoint / EK + (MaxW - ZWidth) / 2), (ETop = 15 / 2 + (MaxH - ZHeight) / 2)); 8263 8263 8264 8264 EleCard.style = "top:" + ETop + "px;left:" + ELeft + "px;width:" + PT.width / EK + "px;height:" + PT.height / EK + "px;"; // 确定位置 8265 8265 EleCard.src = VValue.prototype.PicArr[VValue.prototype.StaticGif]; // 显示僵尸站立图片 ··· 8272 8272 break; 8273 8273 } 8274 8274 8275 - self.SetStyle(Kind), self.SetXRay(XRay); // 初始化显示 8275 + (self.SetStyle(Kind), self.SetXRay(XRay)); // 初始化显示 8276 8276 }, 8277 8277 8278 8278 BirthStyle(self, Id, Ele, Style) { 8279 8279 var Dom = Ele.childNodes[1]; // 获取植物实际图片 8280 - (Dom.src = self.PicArr[self.NormalGif]), (Dom.style.height = "202px"); // 设置实际宽高 8281 - (self.Ele = Ele), EditEle(Ele, { id: Id }, Style, EDPZ); // 修改 8280 + ((Dom.src = self.PicArr[self.NormalGif]), (Dom.style.height = "202px")); // 设置实际宽高 8281 + ((self.Ele = Ele), EditEle(Ele, { id: Id }, Style, EDPZ)); // 修改 8282 8282 8283 - self.InitImage(self.PotSize, self.XRay), self.FreshXRay(true); // 初始化图片等信息 8283 + (self.InitImage(self.PotSize, self.XRay), self.FreshXRay(true)); // 初始化图片等信息 8284 8284 }, 8285 8285 8286 8286 PrivateBirth(self) { ··· 8328 8328 var self = this; 8329 8329 var ID = self.id; // 定义需要用到的变量 8330 8330 8331 - self.oTrigger && oT.delP(self), (self.HP = 0); // 删除触发器 清空血量 8332 - delete $P[ID], delete oGd.$[self.R + "_" + self.C + "_" + self.PKind]; // 删除本格数据 8331 + (self.oTrigger && oT.delP(self), (self.HP = 0)); // 删除触发器 清空血量 8332 + (delete $P[ID], delete oGd.$[self.R + "_" + self.C + "_" + self.PKind]); // 删除本格数据 8333 8333 $P.length -= 1; 8334 8334 !ImgSave && ClearChild(self.Ele); // 清除图片 8335 8335 ··· 8338 8338 } // 随机播放音效 8339 8339 8340 8340 self.ControlBase("Delete", "Auto"); // 删除底座 8341 - ClearChild(self.EleClick), self.PlaceItem(); // 放置物品 8341 + (ClearChild(self.EleClick), self.PlaceItem()); // 放置物品 8342 8342 }, 8343 8343 PlaceItem() { 8344 8344 var self = this; ··· 8355 8355 break; 8356 8356 8357 8357 case "Zombie": // 生成僵尸 8358 - (Value = new Value()), ++oP.NumZombies; // 创建僵尸对象 增加僵尸数量 8358 + ((Value = new Value()), ++oP.NumZombies); // 创建僵尸对象 增加僵尸数量 8359 8359 8360 8360 // 生成僵尸 8361 8361 asyncInnerHTML( 8362 8362 Value.CustomBirth(self.R, self.C, 0, "auto"), 8363 8363 (n, m) => { 8364 - EDPZ.appendChild(n), m.Birth(); 8364 + (EDPZ.appendChild(n), m.Birth()); 8365 8365 if (m.EName === "oJackinTheBoxZombie" && self.AutoJoker) { 8366 8366 m.OpenBox(m.id); 8367 8367 } // 如果是小丑僵尸,直接引爆爆炸 ··· 8372 8372 8373 8373 case "SunNum": // 生成阳光 8374 8374 if (Value > 500) { 8375 - AppearSun(GetX(self.C) - self.width / 2, GetY(self.R) - 30, Value - 500, 0), (Value = 500); 8375 + (AppearSun(GetX(self.C) - self.width / 2, GetY(self.R) - 30, Value - 500, 0), (Value = 500)); 8376 8376 } // 大于五百的阳光直接生成一个大的 8377 8377 while (Value > 25) { 8378 - AppearSun(GetX(self.C) - self.width / 2, GetY(self.R) - 30, 25, 0), (Value -= 25); 8378 + (AppearSun(GetX(self.C) - self.width / 2, GetY(self.R) - 30, 25, 0), (Value -= 25)); 8379 8379 } // 500 以内的,一个一个生成 8380 - AppearSun(GetX(self.C) - self.width / 2, GetY(self.R) - 30, Value, 0), (Value = 0); // 余下的单独生成 8380 + (AppearSun(GetX(self.C) - self.width / 2, GetY(self.R) - 30, Value, 0), (Value = 0)); // 余下的单独生成 8381 8381 break; 8382 8382 } 8383 8383 }, ··· 8472 8472 SpecialBirth(SetR, SetC, VaseColor, VaseValue, SpecialFunc) { 8473 8473 var Obj = new oFlowerVase(); 8474 8474 8475 - (Obj.PotSize = VaseColor), (Obj.VaseValue = VaseValue); // 基本信息 8475 + ((Obj.PotSize = VaseColor), (Obj.VaseValue = VaseValue)); // 基本信息 8476 8476 8477 8477 if (SpecialFunc) { 8478 8478 SpecialFunc(Obj);
+42 -42
game/js/CZombie.js
··· 346 346 return true; 347 347 }, 348 348 getRaven() { 349 - return this.DisappearDie(), 1; 349 + return (this.DisappearDie(), 1); 350 350 }, 351 351 getExplosion() { 352 352 this.ExplosionDie(); ··· 1013 1013 b.ChkActs = b.ChkActs1; 1014 1014 b.ChangeChkActsTo1(b, a, b.EleBody); 1015 1015 b.ResetBackupDancer(b); 1016 - ($(a + "_spotlightCon").style.left = "20px"), ($(a + "_spotlight2Con").style.left = "25px"); 1016 + (($(a + "_spotlightCon").style.left = "20px"), ($(a + "_spotlight2Con").style.left = "25px")); 1017 1017 oP.MonPrgs(); 1018 1018 }, 1019 1019 ResetBackupDancer(f) { ··· 1585 1585 b.ChkActs = b.ChkActs1; 1586 1586 b.ChangeChkActsTo1(b, a, b.EleBody); 1587 1587 b.ResetBackupDancer(b); 1588 - ($(a + "_spotlightCon").style.left = "20px"), ($(a + "_spotlight2Con").style.left = "25px"); 1588 + (($(a + "_spotlightCon").style.left = "20px"), ($(a + "_spotlight2Con").style.left = "25px")); 1589 1589 oP.MonPrgs(); 1590 1590 }, 1591 1591 ResetBackupDancer(f) { ··· 2610 2610 return false; 2611 2611 }, 2612 2612 getRaven(a) { 2613 - return !this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0; 2613 + return (!this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0); 2614 2614 }, 2615 2615 NormalAttack(d, b, g) { 2616 2616 var f = $Z[d]; ··· 2774 2774 return false; 2775 2775 }, 2776 2776 getRaven(a) { 2777 - return !this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0; 2777 + return (!this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0); 2778 2778 }, 2779 2779 NormalAttack(d, b, g) { 2780 2780 var f = $Z[d]; ··· 5258 5258 return false; 5259 5259 }, 5260 5260 getRaven(a) { 5261 - return !this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0; 5261 + return (!this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0); 5262 5262 }, 5263 5263 JudgeAttack() { 5264 5264 var f = this; ··· 5861 5861 var oCJackinTheBoxZombie = InheritO(oJackinTheBoxZombie, { 5862 5862 EName: "oCJackinTheBoxZombie", 5863 5863 }); 5864 - (oBalloonZombie = InheritO(OrnIZombies, { 5864 + ((oBalloonZombie = InheritO(OrnIZombies, { 5865 5865 EName: "oBalloonZombie", 5866 5866 CName: "Balloon Zombie", 5867 5867 OrnHP: 10, ··· 6057 6057 MulBallNum() { 6058 6058 // 减去气球数 6059 6059 if (!this.BreakBall) { 6060 - (this.BreakBall = true), (oGd.$Balloon[this.R] |= 0), --oGd.$Balloon[this.R]; 6060 + ((this.BreakBall = true), (oGd.$Balloon[this.R] |= 0), --oGd.$Balloon[this.R]); 6061 6061 } 6062 6062 }, 6063 6063 getShadow(a) { ··· 6102 6102 var j = $Z[i]; 6103 6103 var k = oGd.$Balloon; 6104 6104 j && ((j.FreeSetbodyTime = 0), SetBlock(g)); 6105 - (k[c] |= 0), ++k[c]; // 增加数量 6105 + ((k[c] |= 0), ++k[c]); // 增加数量 6106 6106 PlayAudio("ballooninflate"); 6107 6107 }, 6108 6108 [c, a, b] ··· 6257 6257 this.Altitude === 1 && this.getHit0(this, 13); 6258 6258 }, 6259 6259 prepareBirth: oZomboni.prototype.prepareBirth, 6260 - })); 6261 - (oJY = InheritO(oBalloonZombie, { 6260 + }))); 6261 + ((oJY = InheritO(oBalloonZombie, { 6262 6262 EName: "oJY", 6263 6263 CName: "Fish Thrower Imp", 6264 6264 OrnHP: 1, ··· 6461 6461 9: "images/Zombies/wall/Zombie/1.gif", 6462 6462 }, 6463 6463 } 6464 - )); 6464 + ))); 6465 6465 oCConeheadZombie = InheritO(OrnIZombies, { 6466 6466 EName: "oCConeheadZombie", 6467 6467 CName: "Bamboo Baskethead Zombie", ··· 6522 6522 }, 6523 6523 } 6524 6524 ); 6525 - (othugZombie = InheritO(OrnNoneZombies, { 6525 + ((othugZombie = InheritO(OrnNoneZombies, { 6526 6526 EName: "othugZombie", 6527 6527 CName: "Assassin Zombie", 6528 6528 HP: 550, ··· 6616 6616 return false; 6617 6617 }, 6618 6618 getRaven(a) { 6619 - return !this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0; 6619 + return (!this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0); 6620 6620 }, 6621 6621 NormalAttack(d, b, g) { 6622 6622 var f = $Z[d]; ··· 6912 6912 [h, f[[(g.NormalGif = g.OrnLostNormalGif), (g.AttackGif = g.OrnLostAttackGif)][b]]] 6913 6913 )); 6914 6914 }, 6915 - })); 6916 - (oZZ = InheritO(OrnNoneZombies, { 6915 + }))); 6916 + ((oZZ = InheritO(OrnNoneZombies, { 6917 6917 EName: "oZZ", 6918 6918 CName: "Wraith Zombie", 6919 6919 Lvl: 4, ··· 7013 7013 })(), 7014 7014 Produce: 7015 7015 '新一代僵王博士登场。<p>体力:<font color="#CC241D">不死之身</font></p>喂!你怎么会在出现在游戏里?我总会听到有玩家这么问。嗯,这都要怪一个叫严启伦的家伙。', 7016 - })); 7017 - (oWJY1 = InheritO(oDuckyTubeZombie1, { 7016 + }))); 7017 + ((oWJY1 = InheritO(oDuckyTubeZombie1, { 7018 7018 EName: "oWJY1", 7019 7019 CName: "Author Zombie-Water", 7020 7020 OSpeed: 0.1, ··· 7613 7613 return true; 7614 7614 }, 7615 7615 getRaven() { 7616 - return this.DisappearDie(), 1; 7616 + return (this.DisappearDie(), 1); 7617 7617 }, 7618 7618 getExplosion() { 7619 7619 this.ExplosionDie(); ··· 8298 8298 b.ChkActs = b.ChkActs1; 8299 8299 b.ChangeChkActsTo1(b, a, b.EleBody); 8300 8300 b.ResetBackupDancer(b); 8301 - ($(a + "_spotlightCon").style.left = "20px"), ($(a + "_spotlight2Con").style.left = "25px"); 8301 + (($(a + "_spotlightCon").style.left = "20px"), ($(a + "_spotlight2Con").style.left = "25px")); 8302 8302 oP.MonPrgs(); 8303 8303 }, 8304 8304 ResetBackupDancer(f) { ··· 9045 9045 return false; 9046 9046 }, 9047 9047 getRaven(a) { 9048 - return !this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0; 9048 + return (!this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0); 9049 9049 }, 9050 9050 NormalAttack(d, b, g) { 9051 9051 var f = $Z[d]; ··· 9783 9783 })(), 9784 9784 AudioArr: ["zombie_entering_water"], 9785 9785 BirthCallBack(a) { 9786 - oAquaticZombie.prototype.BirthCallBack(a), GetC(this.ZX) <= 9 && this.Jump(this); 9786 + (oAquaticZombie.prototype.BirthCallBack(a), GetC(this.ZX) <= 9 && this.Jump(this)); 9787 9787 }, 9788 9788 Jump(a) { 9789 9789 a.beAttacked && ··· 10556 10556 var j = 3 * d + 1; 10557 10557 var i = (h.id = "Z_" + Math.random()); 10558 10558 10559 - (h.R = d), (h.pixelTop = c), (h.zIndex = j), (h.delayT = 0); // 设置其本身不受 delayT 影响 10559 + ((h.R = d), (h.pixelTop = c), (h.zIndex = j), (h.delayT = 0)); // 设置其本身不受 delayT 影响 10560 10560 10561 10561 return h.getHTML(i, h.X, c, j, "none", "auto", h.GetDTop, h.PicArr[h.NormalGif]); 10562 10562 }, ··· 10613 10613 '海豚骑士僵尸善于利用你水池防御的弱点。<p>韧性:<font color="#CC241D">中</font><br>速度:<font color="#CC241D">快,慢(跳越后)</font><br>特点:<font color="#CC241D">跃过他所遇到的第一株植物</font><br>只在水池关卡出现</font></p>那海豚其实也是个僵尸。', 10614 10614 BirthCallBack(a) { 10615 10615 PlayAudio("dolphin_appears"); 10616 - oAquaticZombie.prototype.BirthCallBack(a), GetC(this.ZX) <= 9 && this.Jump(this); 10616 + (oAquaticZombie.prototype.BirthCallBack(a), GetC(this.ZX) <= 9 && this.Jump(this)); 10617 10617 }, 10618 10618 Jump(a) { 10619 10619 a.beAttacked && ··· 10671 10671 return false; 10672 10672 }, 10673 10673 getRaven(a) { 10674 - return !this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0; 10674 + return (!this.isAttacking && this.NormalAttack(this.id, a, $P[a].AttackedLX), 0); 10675 10675 }, 10676 10676 JudgeAttack() { 10677 10677 var f = this; ··· 11073 11073 MulBallNum() { 11074 11074 // 减去气球数 11075 11075 if (!this.BreakBall) { 11076 - (this.BreakBall = true), (oGd.$Balloon[this.R] |= 0), --oGd.$Balloon[this.R]; 11076 + ((this.BreakBall = true), (oGd.$Balloon[this.R] |= 0), --oGd.$Balloon[this.R]); 11077 11077 } 11078 11078 }, 11079 11079 getShadow(a) { ··· 11118 11118 var j = $Z[i]; 11119 11119 var k = oGd.$Balloon; 11120 11120 j && ((j.FreeSetbodyTime = 0), SetBlock(g)); 11121 - (k[c] |= 0), ++k[c]; // 增加数量 11121 + ((k[c] |= 0), ++k[c]); // 增加数量 11122 11122 PlayAudio("ballooninflate"); 11123 11123 }, 11124 11124 [c, a, b] ··· 11276 11276 }); 11277 11277 }, 11278 11278 }); 11279 - })()); 11279 + })())); 11280 11280 oDiggerZombie = InheritO(OrnNoneZombies, { 11281 11281 EName: "oDiggerZombie", 11282 11282 CName: "Digger Zombie", ··· 11317 11317 var e = f.delayT; 11318 11318 var d = f.id; 11319 11319 var c = (f.Ele = $(d)); 11320 - (f.EleShadow = c.firstChild), (f.EleBody = c.childNodes[1]), SetHidden(f.EleShadow); 11320 + ((f.EleShadow = c.firstChild), (f.EleBody = c.childNodes[1]), SetHidden(f.EleShadow)); 11321 11321 e 11322 11322 ? oSym.addTask( 11323 11323 e, ··· 11393 11393 Go_Up(a, WD) { 11394 11394 // WD: 方向,1右0左 11395 11395 a.isUp = 1; //a.Ifgc=0; 11396 - a.beAttacked && 11396 + (a.beAttacked && 11397 11397 ((a.WalkDirection = WD), 11398 11398 (a.BoomDieGif = 12), 11399 11399 PlayAudio("zombie_entering_water"), ··· 11403 11403 (a.OSpeed = a.Speed = 0)), 11404 11404 (a.ChkActs = function () { 11405 11405 return 1; 11406 - }); // 跳起来 11406 + })); // 跳起来 11407 11407 oSym.addTask( 11408 11408 100, 11409 11409 (c, b) => { ··· 11424 11424 WD ? 400 : 0, 11425 11425 (c, b) => { 11426 11426 // 行走 11427 - (b.EleBody.src = b.PicArr[(b.NormalGif = WD ? b.WalkGif1 : b.WalkGif2)]), 11427 + ((b.EleBody.src = b.PicArr[(b.NormalGif = WD ? b.WalkGif1 : b.WalkGif2)]), 11428 11428 (b.OSpeed = b.Speed = 1.6), 11429 - (b.ChkActs = OrnNoneZombies.prototype[WD ? "ChkActs1" : "ChkActs"]); 11429 + (b.ChkActs = OrnNoneZombies.prototype[WD ? "ChkActs1" : "ChkActs"])); 11430 11430 }, 11431 11431 [c, b] 11432 11432 ); ··· 11437 11437 ChkActs(f, d, g, c) { 11438 11438 // 到了左边自己钻出来 11439 11439 if (f.Altitude === 0 && f.AttackedRX < GetX(1) - 40) { 11440 - return f.Go_Up(f, 1), 1; 11440 + return (f.Go_Up(f, 1), 1); 11441 11441 } 11442 11442 11443 11443 var b; ··· 11500 11500 g.Stone_of_Sinan_Up = function () {}; 11501 11501 }, 11502 11502 }); 11503 - (oIDiggerZombie = InheritO(OrnNoneZombies, { 11503 + ((oIDiggerZombie = InheritO(OrnNoneZombies, { 11504 11504 EName: "oIDiggerZombie", 11505 11505 CName: "Digger Zombie", 11506 11506 Lvl: 4, ··· 11540 11540 var e = f.delayT; 11541 11541 var d = f.id; 11542 11542 var c = (f.Ele = $(d)); 11543 - (f.EleShadow = c.firstChild), (f.EleBody = c.childNodes[1]), SetHidden(f.EleShadow); 11543 + ((f.EleShadow = c.firstChild), (f.EleBody = c.childNodes[1]), SetHidden(f.EleShadow)); 11544 11544 e 11545 11545 ? oSym.addTask( 11546 11546 e, ··· 11616 11616 Go_Up(a, WD) { 11617 11617 // WD: 方向,1右0左 11618 11618 a.isUp = 1; //a.Ifgc=0; 11619 - a.beAttacked && 11619 + (a.beAttacked && 11620 11620 ((a.WalkDirection = WD), 11621 11621 (a.BoomDieGif = 12), 11622 11622 PlayAudio("zombie_entering_water"), ··· 11626 11626 (a.OSpeed = a.Speed = 0)), 11627 11627 (a.ChkActs = function () { 11628 11628 return 1; 11629 - }); // 跳起来 11629 + })); // 跳起来 11630 11630 oSym.addTask( 11631 11631 100, 11632 11632 (c, b) => { ··· 11647 11647 WD ? 400 : 0, 11648 11648 (c, b) => { 11649 11649 // 行走 11650 - (b.EleBody.src = b.PicArr[(b.NormalGif = WD ? b.WalkGif1 : b.WalkGif2)]), 11650 + ((b.EleBody.src = b.PicArr[(b.NormalGif = WD ? b.WalkGif1 : b.WalkGif2)]), 11651 11651 (b.OSpeed = b.Speed = 1.6), 11652 - (b.ChkActs = OrnNoneZombies.prototype[WD ? "ChkActs1" : "ChkActs"]); 11652 + (b.ChkActs = OrnNoneZombies.prototype[WD ? "ChkActs1" : "ChkActs"])); 11653 11653 }, 11654 11654 [c, b] 11655 11655 ); ··· 11660 11660 ChkActs(f, d, g, c) { 11661 11661 // 到了左边自己钻出来 11662 11662 if (f.Altitude === 0 && f.AttackedRX < GetX(1) - 40) { 11663 - return f.Go_Up(f, 1), 1; 11663 + return (f.Go_Up(f, 1), 1); 11664 11664 } 11665 11665 11666 11666 var b; ··· 11794 11794 } 11795 11795 this.DisappearDie(); 11796 11796 }, 11797 - })); 11797 + }))); 11798 11798 oPeaZombie = InheritO(oZombie, { 11799 11799 EName: "oPeaZombie", 11800 11800 CName: "Peashooter Zombie",
+3111 -2640
game/js/Cfunction.js
··· 1 + /* eslint-disable complexity */ 1 2 var $User = (function () { 2 - var b = navigator.platform; 3 - var i = navigator.userAgent; 4 - var f = b === "Win32" || b === "Windows"; 5 - var g = b === "Mac68K" || b === "MacPPC" || b === "Macintosh"; 6 - var d = b === "X11" && !f && !g; 7 - var h = f || g || d; 8 - var a = ""; 9 - var c = !!(window.attachEvent && !window.opera); 10 - var e = c && !window.XMLHttpRequest; 11 - var j = location.protocol.toLowerCase() === "http:" ? 1 : 0; 12 - $Random = j ? "#" : "?"; 13 - innerText = c 14 - ? function (l, k) { 15 - l.innerText = k; 3 + const platform = navigator.platform; 4 + const userAgent = navigator.userAgent; 5 + const isWin = platform === "Win32" || platform === "Windows"; 6 + const isMac = platform === "Mac68K" || platform === "MacPPC" || platform === "Macintosh"; 7 + const isUnix = platform === "X11" && !isWin && !isMac; 8 + const isPC = isWin || isMac || isUnix; 9 + 10 + const isIE = !!(window.attachEvent && !window.opera); 11 + const isIE6 = isIE && !window.XMLHttpRequest; 12 + const isHTTP = location.protocol.toLowerCase() === "http:" ? 1 : 0; 13 + 14 + // Global Random Helper 15 + $Random = isHTTP ? "#" : "?"; 16 + 17 + // Text setting helper based on browser capability 18 + innerText = isIE 19 + ? function (element, text) { 20 + element.innerText = text; 16 21 } 17 - : function (l, k) { 18 - l.textContent = k; 22 + : function (element, text) { 23 + element.textContent = text; 19 24 }; 20 - e ? (document.execCommand("BackgroundImageCache", false, true), (ShadowPNG = "")) : (ShadowPNG = "images/interface/plantshadow32.png"); 25 + 26 + // PNG fix for IE6 27 + if (isIE6) { 28 + document.execCommand("BackgroundImageCache", false, true); 29 + ShadowPNG = ""; 30 + } else { 31 + ShadowPNG = "images/interface/plantshadow32.png"; 32 + } 33 + 21 34 innerHTML = function (element, content) { 22 35 if (element) { 23 36 element.innerHTML = content; 24 37 } 25 38 }; 39 + 26 40 return { 27 41 Browser: { 28 - IE: c, 29 - IE6: e, 30 - IE9: c && i.indexOf("MSIE 9.0") > 0, 42 + IE: isIE, 43 + IE6: isIE6, 44 + IE9: isIE && userAgent.indexOf("MSIE 9.0") > 0, 31 45 Opera: !!window.opera, 32 - WebKit: i.includes("AppleWebKit/"), 33 - Gecko: i.includes("Gecko") && !i.includes("KHTML"), 46 + WebKit: userAgent.includes("AppleWebKit/"), 47 + Gecko: userAgent.includes("Gecko") && !userAgent.includes("KHTML"), 34 48 }, 35 49 Server: { 36 - List: [[]], 37 - SpeedURL: "", 38 - DataURL: "", 39 - SpeedInx: 0, 40 - DataInx: 0, 41 - ErrNum: 0, 50 + URL: "https://backend.pvzm.net", 42 51 }, 43 52 HTML5: (function () { 44 53 return !!document.createElement("canvas").getContext; 45 54 })(), 46 - System: { Win: f, Mac: g, Unix: d }, 47 - Client: { PC: h, Mobile: !h }, 48 - HTTP: j, 49 - AuthorWebsite: a, 55 + System: { Win: isWin, Mac: isMac, Unix: isUnix }, 56 + Client: { PC: isPC, Mobile: !isPC }, 57 + HTTP: isHTTP, 58 + AuthorWebsite: "", 50 59 isAuthorWebsite: false, 51 60 Visitor: { 52 61 UserName: "", ··· 60 69 }, 61 70 }; 62 71 })(); 72 + 63 73 var oSym = { 64 - // initialize the symbol object 65 - Init(b, a) { 66 - this.Now = 0; // current time 67 - this.Timer = this.execTask = null; // timer and task execution variables 68 - this.TQ = [{ T: 0, f: b, ar: a || [] }]; // task queue, initialized with the first task 69 - this.NowStep = 1; // time step for advancing current time 70 - this.TimeStep = 10; // time interval for timers 71 - this.Start(); // start the symbol object's timers 74 + // Initialize the symbol object 75 + Init(callback, args) { 76 + this.Now = 0; // Current time 77 + this.Timer = null; 78 + this.execTask = null; 79 + // Task Queue: { Time, Function, Arguments } 80 + this.TQ = [{ T: 0, f: callback, ar: args || [] }]; 81 + this.NowStep = 1; // Time increment step 82 + this.TimeStep = 10; // Real-time ms per step 83 + this.Start(); 72 84 }, 73 - // clear all tasks from the queue 85 + // Clear all tasks 74 86 Clear() { 75 87 this.TQ.length = 0; 76 88 }, 77 - // start the symbol object's timers 89 + // Start timers 78 90 Start() { 79 91 if (this.Timer == null) { 80 - // only start if not already started 81 - // timer to advance the current time 82 - (function () { 83 - var a = oSym; 92 + // Timer 1: Advance internal game time (Now) 93 + (function stepTime() { 84 94 try { 85 - a.Now += a.NowStep; // increment current time 86 - } catch (b) { 87 - alert("Timeout to quit the game"); // error handling for timeout 88 - location.reload(); // reload the page 95 + oSym.Now += oSym.NowStep; 96 + } catch (e) { 97 + alert("Timeout to quit the game"); 98 + location.reload(); 89 99 } 90 - a.Timer = setTimeout(arguments.callee, a.TimeStep); // set next timeout 100 + oSym.Timer = setTimeout(stepTime, oSym.TimeStep); 91 101 })(); 92 - // timer to execute tasks from the queue 93 - (function () { 94 - var d = oSym; 95 - var a = d.TQ; // task queue 96 - var c = a.length; 97 - var b; // current task 98 - var e; // task function 99 - while (c--) { 100 - // iterate through tasks in reverse 101 - if (d.Now >= (b = a[c]).T) { 102 - // if task time is due 102 + 103 + // Timer 2: Execute tasks based on game time 104 + (function runTasks() { 105 + const sym = oSym; 106 + const queue = sym.TQ; 107 + let len = queue.length; 108 + let task, func; 109 + 110 + // Iterate backwards to allow safe removal 111 + while (len--) { 112 + task = queue[len]; 113 + if (sym.Now >= task.T) { 103 114 try { 104 - (e = b.f).apply(e, b.ar); // execute task function with arguments 105 - } catch (Reason) { 106 - console.error(Reason); // log any errors during task execution 115 + func = task.f; 116 + func.apply(func, task.ar); 117 + } catch (err) { 118 + console.error(err); 107 119 } 108 - d.removeTask(c); // remove executed task from queue 120 + sym.removeTask(len); 109 121 } 110 122 } 111 - d.execTask = setTimeout(arguments.callee, d.TimeStep); // set next timeout for task execution 123 + sym.execTask = setTimeout(runTasks, sym.TimeStep); 112 124 })(); 113 125 } 114 126 }, 115 - // stop the symbol object's timers 127 + // Stop timers 116 128 Stop() { 117 - clearTimeout(oSym.Timer); // clear current time timer 118 - clearTimeout(oSym.execTask); // clear task execution timer 119 - oSym.Timer = null; // reset timer variable 120 - oSym.execTask = null; // reset task execution variable 129 + clearTimeout(oSym.Timer); 130 + clearTimeout(oSym.execTask); 131 + oSym.Timer = null; 132 + oSym.execTask = null; 121 133 }, 122 - // add a new task to the queue 123 - addTask(b, c, a) { 124 - var d = this.TQ; 125 - // add task with its scheduled time (Now + delay), function, and arguments 126 - d[d.length] = { T: this.Now + b, f: c, ar: a }; 134 + // Add task to queue 135 + addTask(delay, func, args) { 136 + const queue = this.TQ; 137 + queue[queue.length] = { 138 + T: this.Now + delay, 139 + f: func, 140 + ar: args, 141 + }; 127 142 return this; 128 143 }, 129 - // remove a task from the queue by its index 130 - removeTask(a) { 131 - this.TQ.splice(a, 1); // remove task at the given index 144 + // Remove task by index 145 + removeTask(index) { 146 + this.TQ.splice(index, 1); 132 147 return this; 133 148 }, 134 149 }; 150 + 135 151 var oS = { 136 152 Version: 5, 137 153 W: 880, 138 154 H: 600, 139 - C: 9, 155 + C: 9, // Columns 140 156 B: atob, 141 157 LawnMowerX: 70, 142 158 Lvl: 0, ··· 145 161 SelfVariables: [], 146 162 LvlClearFunc: null, 147 163 AutoSun: 0, 148 - Init(e, g, b, d) { 149 - var c; 150 - var a = window; 151 - e.LoadMusic ? (PlayMusic(e.LoadMusic), NewAudio({ source: "ChooseYourSeeds", loop: true })) : PlayMusic((e.LoadMusic = "ChooseYourSeeds")); 152 - if (b !== d) { 153 - for (c in b) { 154 - a[c] !== d ? ((this.GlobalVariables[c] = a[c]), (a[c] = b[c])) : (this.LvlVariables[c] = a[c] = b[c]); 164 + 165 + // Initialize Level 166 + Init(config, prototypeData, savedData, sunNum) { 167 + const win = window; 168 + 169 + // Handle Music 170 + if (config.LoadMusic) { 171 + PlayMusic(config.LoadMusic); 172 + NewAudio({ source: "ChooseYourSeeds", loop: true }); 173 + } else { 174 + PlayMusic((config.LoadMusic = "ChooseYourSeeds")); 175 + } 176 + 177 + // Restore/Save Variables 178 + if (savedData !== sunNum) { 179 + for (let key in savedData) { 180 + if (win[key] !== sunNum) { 181 + this.GlobalVariables[key] = win[key]; 182 + win[key] = savedData[key]; 183 + } else { 184 + this.LvlVariables[key] = win[key] = savedData[key]; 185 + } 155 186 } 156 187 } 188 + 189 + // Reset Global Lists 157 190 ArCard = []; 158 191 ArPCard = []; 159 192 ArSun = []; 160 193 $Pn = []; 161 194 $Z = []; 162 195 $P = []; 196 + 197 + // DOM Element setup 163 198 EDAll = $("dAll"); 164 199 EDPZ = $("dPZ"); 165 200 EDAlloffsetLeft = EDAll.offsetLeft; 166 201 EDNewAll = EDAll.cloneNode(true); 167 202 EDNewFlagMeter = $("dFlagMeter").cloneNode(true); 168 203 ESSunNum = $("sSunNum"); 204 + 169 205 this.AudioArr = []; 170 206 this.MustAllReady = true; 171 207 this.LoadAccess = null; ··· 175 211 this.PicNum = this.AccessNum = this.MCID = this.Chose = 0; 176 212 this.Monitor = null; 177 213 this.UserDefinedFlagFunc = null; 178 - this.SunNum = d; 179 - this.BrainsNum = d; 214 + this.SunNum = sunNum; 215 + this.BrainsNum = sunNum; // Logic implies sunNum is passed as argument d 180 216 this.HaveFog = 0; 181 217 182 - var savedAutoSun = localStorage.getItem("JSPVZAutoSun"); 218 + // AutoSun Logic 219 + const savedAutoSun = localStorage.getItem("JSPVZAutoSun"); 183 220 if (savedAutoSun !== null) { 184 221 this.AutoSun = parseInt(savedAutoSun); 185 222 if (this.AutoSun) { 186 223 AutoClickSun(); 187 224 } 188 225 } 189 - 190 - var checkbox = document.getElementById("cAutoSun"); 226 + const checkbox = document.getElementById("cAutoSun"); 191 227 if (checkbox) { 192 228 checkbox.checked = !!this.AutoSun; 193 229 } 194 230 195 - for (c in e) { 196 - this.SelfVariables.push(c); 197 - this[c] = e[c]; 231 + // Load Config into this object 232 + for (let key in config) { 233 + this.SelfVariables.push(key); 234 + this[key] = config[key]; 198 235 } 199 - $User.isAuthorWebsite && 200 - oS.LevelEName !== 0 && 201 - (ClearChild($("JSPVZAjax")), 236 + 237 + // Save Position Logic 238 + if ($User.isAuthorWebsite && oS.LevelEName !== 0) { 239 + ClearChild($("JSPVZAjax")); 202 240 NewEle( 203 241 "JSPVZAjax", 204 242 "script", ··· 208 246 type: "text/javascript", 209 247 }, 210 248 document.body 211 - )); 212 - !this.PicArr && (this.PicArr = []); 213 - !this.PName && (this.PName = []); 214 - !this.ZName && (this.ZName = []); 215 - !this.backgroundImage && (this.backgroundImage = "images/interface/background1.jpg"); 216 - !this.LF && (this.LF = [0, 1, 1, 1, 1, 1]); 217 - !this.ZF && (this.ZF = this.LF); 218 - !this.LargeWaveFlag && (this.LargeWaveFlag = {}); 219 - !this.StartGameMusic && (this.StartGameMusic = "Grasswalk"); 220 - this.ArCard = this.CardKind === d ? e.PName : e.ZName; 221 - this.SunNum === d && (this.SunNum = 50); 222 - this.CanSelectCard === d && (this.CanSelectCard = 1); 223 - this.DKind === d && (this.DKind = 1); 224 - this.StaticCard === d && (this.StaticCard = 1); 225 - this.ShowScroll === d && (this.ShowScroll = true); 226 - this.ProduceSun === d && (this.ProduceSun = true); 227 - this.Coord === d && (this.Coord = 1); 249 + ); 250 + } 251 + 252 + // Defaults 253 + if (!this.PicArr) this.PicArr = []; 254 + if (!this.PName) this.PName = []; 255 + if (!this.ZName) this.ZName = []; 256 + if (!this.backgroundImage) this.backgroundImage = "images/interface/background1.jpg"; 257 + if (!this.LF) this.LF = [0, 1, 1, 1, 1, 1]; // Lane types 258 + if (!this.ZF) this.ZF = this.LF; // Zombie spawn lanes 259 + if (!this.LargeWaveFlag) this.LargeWaveFlag = {}; 260 + if (!this.StartGameMusic) this.StartGameMusic = "Grasswalk"; 261 + 262 + this.ArCard = this.CardKind === sunNum ? config.PName : config.ZName; 263 + 264 + if (this.SunNum === sunNum) this.SunNum = 50; 265 + if (this.CanSelectCard === sunNum) this.CanSelectCard = 1; 266 + if (this.DKind === sunNum) this.DKind = 1; 267 + if (this.StaticCard === sunNum) this.StaticCard = 1; 268 + if (this.ShowScroll === sunNum) this.ShowScroll = true; 269 + if (this.ProduceSun === sunNum) this.ProduceSun = true; 270 + if (this.Coord === sunNum) this.Coord = 1; 271 + 272 + // Initialize Systems 228 273 oCoord[this.Coord](); 229 - oP.Init(g); 274 + oP.Init(prototypeData); 230 275 oT.Init(this.R); 231 276 oZ.Init(this.R); 232 277 oGd.Init(); ··· 234 279 this.LoadProgress(); 235 280 }, 236 281 LoadTips() { 237 - var b = NewEle("dTips", "div", "position:absolute;color:#fff;top:450px;width:100%;text-align:center;font-size:16px", "", EDAll); 238 - var a = [ 282 + const tipsDiv = NewEle("dTips", "div", "position:absolute;color:#fff;top:450px;width:100%;text-align:center;font-size:16px", "", EDAll); 283 + const tips = [ 239 284 "Some zombies wear hats, strong hats.", 240 285 "Clicking on Balloonatics gives you extra sun! Get ready for those little suckers at the start of every wave!", 241 286 'There have been rumors about "Alien Balloons" wandering around Neighborville and their "Green Glow", but I personally dont believe them.', ··· 245 290 "Sunflowers produce sun.", 246 291 "Peashooters shoot peas", 247 292 ]; 248 - b.innerHTML = '<span style="font-weight:bold"></span><span>' + a[Math.floor(Math.random() * a.length)] + "</span>"; 293 + tipsDiv.innerHTML = `<span style="font-weight:bold"></span><span>${tips[Math.floor(Math.random() * tips.length)]}</span>`; 249 294 }, 250 295 LoadProgress(r, l, a, t, b) { 251 296 SetVisible($("dFlagMeter")); 252 297 SetHidden($("imgGQJC")); 253 - var p = oS; 254 - var j = []; 255 - var i = p.PicArr; 256 - var k = p.PName; 257 - var s = p.ZName; 258 - var w = 0; 259 - var u = GetX(11); 260 - var g = oGd.$LF; 261 - var c = oGd.$ZF; 262 - var d = oS.R + 1; 263 - var x = $("sFlagMeterTitleF"); 264 - var y = $("dFlagMeterTitle"); 265 - var e = p.LoadImage; 266 - var h = p.CheckImg; 267 - var f = p.InitPn; 268 - var m; 269 - var q; 298 + 299 + const self = oS; 300 + const picArr = self.PicArr; 301 + const pNames = self.PName; 302 + const zNames = self.ZName; 303 + const backgroundWidth = GetX(11); 304 + const zLanes = oGd.$ZF; 305 + const maxR = oS.R + 1; 306 + const titleDiv = $("dFlagMeterTitle"); 307 + 308 + // Brain and Cleaner Elements 270 309 NewImg(0, "images/interface/brain.png", "", ($Pn.oBrains = NewEle(0, "div", "position:absolute"))); 271 - switch (p.Coord) { 310 + switch (self.Coord) { 272 311 case 2: 273 312 NewImg(0, "images/interface/PoolCleaner.png", "", ($Pn.oPoolCleaner = NewEle(0, "div", "position:absolute"))); 313 + // fallthrough 274 314 case 1: 275 315 NewImg(0, "images/interface/LawnCleaner.png", "", ($Pn.oLawnCleaner = NewEle(0, "div", "position:absolute"))); 276 316 break; 277 317 } 278 - while (r--) { 279 - a = (l = k[r].prototype).PicArr.slice(0); 280 - Array.prototype.push.apply(i, a); 318 + 319 + // Load Plant Resources 320 + let i = pNames.length; 321 + while (i--) { 322 + let proto = pNames[i].prototype; 323 + Array.prototype.push.apply(picArr, proto.PicArr.slice(0)); 281 324 if ($User.HTML5) { 282 - t = l.AudioArr; 283 - b = t.length; 284 - while (b--) { 285 - NewAudio({ source: t[b] }); 325 + let audioArr = proto.AudioArr; 326 + let audioLen = audioArr.length; 327 + while (audioLen--) { 328 + NewAudio({ source: audioArr[audioLen] }); 286 329 } 287 330 } 288 331 } 289 - for (r in oS.LargeWaveFlag) { 290 - s[s.length] = oS.FlagZombie || oFlagZombie; 332 + 333 + // Ensure Flag Zombie exists for large waves 334 + for (let flag in oS.LargeWaveFlag) { 335 + zNames[zNames.length] = oS.FlagZombie || oFlagZombie; 291 336 break; 292 337 } 293 - r = s.length; 294 - while (r--) { 295 - Array.prototype.push.apply(i, (l = (q = s[r]).prototype).PicArr.slice(0)); 338 + 339 + // Load Zombie Resources and Init 340 + let j = zNames.length; 341 + while (j--) { 342 + let zombieClass = zNames[j]; 343 + let proto = zombieClass.prototype; 344 + Array.prototype.push.apply(picArr, proto.PicArr.slice(0)); 296 345 if ($User.HTML5) { 297 - t = l.AudioArr; 298 - b = t.length; 299 - while (b--) { 300 - NewAudio({ source: t[b] }); 346 + let audioArr = proto.AudioArr; 347 + let audioLen = audioArr.length; 348 + while (audioLen--) { 349 + NewAudio({ source: audioArr[audioLen] }); 301 350 } 302 351 } 303 - l.Init.call(q, u, l, c, d); 352 + proto.Init.call(zombieClass, backgroundWidth, proto, zLanes, maxR); 304 353 } 305 - p.PicNum = w += i.length; 306 - r = i.length; 307 - y.setAttribute("title", ""); 308 - y.style.cursor = "url(images/interface/Pointer.cur),pointer"; 309 - y.onclick = function () { 354 + 355 + self.PicNum = picArr.length; 356 + let k = picArr.length; 357 + 358 + // Setup Start Click 359 + titleDiv.setAttribute("title", ""); 360 + titleDiv.style.cursor = "url(images/interface/Pointer.cur),pointer"; 361 + titleDiv.onclick = function () { 310 362 oS.MustAllReady = false; 311 363 oS.LoadReady(oS); 312 364 }; 313 - while (r--) { 314 - e(i[r], h); 365 + 366 + // Preload Images 367 + while (k--) { 368 + self.LoadImage(picArr[k], self.CheckImg); 315 369 } 316 - r = j.length; 370 + 317 371 oS.LoadAudio(); 318 372 }, 319 373 LoadAudio: $User.HTML5 320 374 ? function () { 321 - var b = oS.AudioArr; 322 - var a = b.length; 323 - while (a--) { 324 - NewAudio({ source: b[a] }); 375 + let i = oS.AudioArr.length; 376 + while (i--) { 377 + NewAudio({ source: oS.AudioArr[i] }); 325 378 } 326 379 } 327 380 : function () {}, 328 - InitPn(a) { 329 - var b = ($Pn[a[0]] = NewEle(0, "div", "position:absolute")); 330 - NewImg(0, ShadowPNG, a[2], b); 331 - NewImg(0, a[1], "", b); 381 + InitPn(arr) { 382 + const ele = ($Pn[arr[0]] = NewEle(0, "div", "position:absolute")); 383 + NewImg(0, ShadowPNG, arr[2], ele); 384 + NewImg(0, arr[1], "", ele); 332 385 oS.CheckImg(); 333 386 }, 334 387 LoadImage: $User.Browser.IE 335 - ? function (b, d, c) { 336 - var a = new Image(); 337 - a.onreadystatechange = function () { 338 - a.readyState === "complete" && d(c, 1); 388 + ? function (src, callback, args) { 389 + const img = new Image(); 390 + img.onreadystatechange = function () { 391 + if (img.readyState === "complete") callback(args, 1); 339 392 }; 340 - a.onerror = function () { 341 - a.onreadystatechange = null; 342 - a.title = b; 343 - d(c, 0); 393 + img.onerror = function () { 394 + img.onreadystatechange = null; 395 + img.title = src; 396 + callback(args, 0); 344 397 }; 345 - a.src = b; 398 + img.src = src; 346 399 } 347 - : function (b, d, c) { 348 - var a = new Image(); 349 - a.src = b; 350 - a.complete 351 - ? d(c, 1) 352 - : ((a.onload = function () { 353 - a.complete && d(c, 1); 354 - }), 355 - (a.onerror = function () { 356 - a.title = b; 357 - d(c, 0); 358 - })); 400 + : function (src, callback, args) { 401 + const img = new Image(); 402 + img.src = src; 403 + if (img.complete) { 404 + callback(args, 1); 405 + } else { 406 + img.onload = function () { 407 + if (img.complete) callback(args, 1); 408 + }; 409 + img.onerror = function () { 410 + img.title = src; 411 + callback(args, 0); 412 + }; 413 + } 359 414 }, 360 415 LoadScript: $User.Browser.IE 361 - ? function (f, c, e, a, d) { 362 - var b = NewEle(f, "script", 0, { type: "text/javascript" }); 363 - b.onreadystatechange = function () { 364 - (b.readyState === "loaded" || b.readyState === "complete") && ((b.onreadystatechange = null), e(d, 1)); 416 + ? function (id, src, callback, parent, args) { 417 + const script = NewEle(id, "script", 0, { type: "text/javascript" }); 418 + script.onreadystatechange = function () { 419 + if (script.readyState === "loaded" || script.readyState === "complete") { 420 + script.onreadystatechange = null; 421 + callback(args, 1); 422 + } 365 423 }; 366 - b.onerror = function () { 367 - b.onreadystatechange = null; 368 - e(d, 0); 424 + script.onerror = function () { 425 + script.onreadystatechange = null; 426 + callback(args, 0); 369 427 }; 370 - b.src = c; 371 - a.appendChild(b); 428 + script.src = src; 429 + parent.appendChild(script); 372 430 } 373 - : function (f, c, e, a, d) { 374 - var b = NewEle(f, "script", 0, { type: "text/javascript" }); 375 - b.onload = function () { 376 - e(d, 1); 431 + : function (id, src, callback, parent, args) { 432 + const script = NewEle(id, "script", 0, { type: "text/javascript" }); 433 + script.onload = function () { 434 + callback(args, 1); 377 435 }; 378 - b.onerror = function () { 379 - e(d, 0); 436 + script.onerror = function () { 437 + callback(args, 0); 380 438 }; 381 - b.src = c; 382 - a.appendChild(b); 439 + script.src = src; 440 + parent.appendChild(script); 383 441 }, 384 442 CheckImg(b, a) { 385 - var c = oS; 386 - if (c.AccessNum > c.PicNum || !c.MustAllReady) { 443 + const self = oS; 444 + if (self.AccessNum > self.PicNum || !self.MustAllReady) { 387 445 return; 388 446 } 389 - b = 139 - (c.AccessNum++ * 140) / c.PicNum - 11; 390 - $("imgFlagHead").style.left = b + "px"; 447 + // Calculate progress bar position 448 + const pos = 139 - (self.AccessNum++ * 140) / self.PicNum - 11; 449 + $("imgFlagHead").style.left = pos + "px"; 391 450 $("sFlagMeterTitleF").innerHTML = 392 - '<span style="cursor:url(images/interface/Pointer.cur),pointer;font-family:Tahoma;color:#fff">Loading...(' + 393 - c.AccessNum + 394 - "/" + 395 - c.PicNum + 396 - ")</span>"; 397 - $("imgFlagMeterFull").style.clip = "rect(0,auto,21px," + (b + 11) + "px)"; 398 - if (c.AccessNum === c.PicNum) { 399 - oS.Lvl === 0; 400 - if (c.MustAllReady) { 401 - c.LoadReady(c); 451 + `<span style="cursor:url(images/interface/Pointer.cur),pointer;font-family:Tahoma;color:#fff">Loading...(${self.AccessNum}/${self.PicNum})</span>`; 452 + $("imgFlagMeterFull").style.clip = "rect(0,auto,21px," + (pos + 11) + "px)"; 453 + 454 + if (self.AccessNum === self.PicNum) { 455 + if (self.MustAllReady) { 456 + self.LoadReady(self); 402 457 } 403 458 } 404 459 }, 405 - LoadReady(f) { 406 - var c = $("dFlagMeterTitle"); 407 - if (c.onclick == null) { 408 - return; 409 - } 460 + LoadReady(config) { 461 + const titleDiv = $("dFlagMeterTitle"); 462 + if (titleDiv.onclick == null) return; 463 + 410 464 ClearChild($("dTips")); 411 465 oSym.NowStep = $User.Visitor.NowStep; 412 466 oSym.TimeStep = $User.Visitor.TimeStep; 413 - c.onclick = null; 414 - c.title = null; 415 - c.style.cursor = "url(images/interface/Cursor.cur),default"; 467 + titleDiv.onclick = null; 468 + titleDiv.title = null; 469 + titleDiv.style.cursor = "url(images/interface/Cursor.cur),default"; 470 + 416 471 SetHidden($("dFlagMeterContent"), dFlagMeter); 417 472 $("dFlagMeter").style.top = "490px"; 418 - // $("dFlagMeter").style.left = "805px"; // not good 419 - // $("dFlagMeter").style.left = (currentLeft + 15) + "px"; // not good either 420 - $("sFlagMeterTitleF").innerHTML = $("dFlagMeterTitleB").innerHTML = f.LevelName; 473 + $("sFlagMeterTitleF").innerHTML = $("dFlagMeterTitleB").innerHTML = config.LevelName; 421 474 $("imgFlagHead").style.left = "139px"; 422 475 $("imgFlagMeterFull").style.clip = "rect(0,auto,auto,157px)"; 423 - delete f.PicArr; 424 - delete f.Coord; 425 - delete f.LF; 426 - delete f.ZF; 427 - var a = { 428 - background: "url(" + f.backgroundImage + ") no-repeat", 476 + 477 + // Cleanup config object 478 + delete config.PicArr; 479 + delete config.Coord; 480 + delete config.LF; 481 + delete config.ZF; 482 + 483 + const bgStyle = { 484 + background: "url(" + config.backgroundImage + ") no-repeat", 429 485 visibility: "visible", 430 486 }; 431 - !f.ShowScroll && (a.left = "-115px"); 432 - SetStyle($("tGround"), a); 487 + if (!config.ShowScroll) bgStyle.left = "-115px"; 488 + 489 + SetStyle($("tGround"), bgStyle); 433 490 $("tGround").innerHTML = oS.GifHTML; 434 - var d = function (h) { 435 - var i = oS; 436 - var g = $User.Visitor; 491 + 492 + const startGame = function (delay) { 493 + const self = oS; 437 494 NewImg("imgGrowSoil", "images/interface/GrowSoil.gif", "visibility:hidden;z-index:50", EDAll); 438 495 NewImg("imgGrowSpray", "images/interface/GrowSpray.gif", "visibility:hidden;z-index:50", EDAll); 439 - innerText(ESSunNum, i.SunNum); 496 + innerText(ESSunNum, self.SunNum); 440 497 InitPCard(); 441 - i.ShowScroll 442 - ? oSym.addTask( 443 - h === undefined ? 200 : h, 444 - (j) => { 445 - ClearChild(j); 446 - i.ScrollScreen(); 447 - }, 448 - [NewEle("DivParty", "div", "line-height:50px;color:#FFFFFF;font-size:50px;font-family:Tahoma", {}, EDAll)] 449 - ) 450 - : (SetVisible($("dMenu")), AutoSelectCard(), LetsGO()); 498 + 499 + if (self.ShowScroll) { 500 + oSym.addTask( 501 + delay === undefined ? 200 : delay, 502 + (div) => { 503 + ClearChild(div); 504 + self.ScrollScreen(); 505 + }, 506 + [NewEle("DivParty", "div", "line-height:50px;color:#FFFFFF;font-size:50px;font-family:Tahoma", {}, EDAll)] 507 + ); 508 + } else { 509 + SetVisible($("dMenu")); 510 + AutoSelectCard(); 511 + LetsGO(); 512 + } 451 513 }; 452 - f.LoadAccess ? f.LoadAccess(d) : d(); 514 + 515 + config.LoadAccess ? config.LoadAccess(startGame) : startGame(); 453 516 }, 454 517 ScrollScreen() { 455 - (EDAll.scrollLeft += 25) < 500 456 - ? oSym.addTask(2, arguments.callee, []) 457 - : (DisplayZombie(), 458 - SetVisible($("dMenu")), 459 - oS.CanSelectCard ? SetVisible($("dTop"), $("dSelectCard"), $("dCardList")) : (AutoSelectCard(), oSym.addTask(200, oS.ScrollBack, [LetsGO]))); 518 + if ((EDAll.scrollLeft += 25) < 500) { 519 + oSym.addTask(2, arguments.callee, []); 520 + } else { 521 + DisplayZombie(); 522 + SetVisible($("dMenu")); 523 + if (oS.CanSelectCard) { 524 + SetVisible($("dTop"), $("dSelectCard"), $("dCardList")); 525 + } else { 526 + AutoSelectCard(); 527 + oSym.addTask(200, oS.ScrollBack, [LetsGO]); 528 + } 529 + } 460 530 }, 461 - ScrollBack(a) { 531 + ScrollBack(callback) { 462 532 SetHidden($("dZombie"), $("dSelectCard"), $("dTitle"), $("dCardList")); 463 533 $("tGround").style.left = "-115px"; 464 534 $("dZombie").innerHTML = ""; 465 - (function (c) { 466 - var b = EDAll.scrollLeft; 467 - (b -= 25) > 0 ? ((EDAll.scrollLeft = b), oSym.addTask(2, arguments.callee, [c])) : ((EDAll.scrollLeft = 0), c()); 468 - })(a); 535 + 536 + (function scrollStep(cb) { 537 + let scroll = EDAll.scrollLeft; 538 + if ((scroll -= 25) > 0) { 539 + EDAll.scrollLeft = scroll; 540 + oSym.addTask(2, scrollStep, [cb]); 541 + } else { 542 + EDAll.scrollLeft = 0; 543 + cb(); 544 + } 545 + })(callback); 469 546 }, 470 547 }; 548 + 471 549 var oCoord = { 550 + // 5-Row Layout 472 551 1() { 473 552 oS.R = 5; 474 - ChosePlantX = function (a) { 475 - return Compare(GetC(a), 1, oS.C, GetX); 553 + ChosePlantX = function (x) { 554 + return Compare(GetC(x), 1, oS.C, GetX); 476 555 }; 477 - ChosePlantY = function (a) { 556 + ChosePlantY = function (y) { 478 557 return $SSml( 479 - a, 558 + y, 480 559 [86, 181, 281, 386, 476], 481 560 [ 482 561 [75, 0], ··· 488 567 ] 489 568 ); 490 569 }; 491 - GetC = function (a) { 492 - return $SSml(a, [-50, 100, 140, 220, 295, 379, 460, 540, 625, 695, 775, 855, 935], [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); 570 + GetC = function (x) { 571 + return $SSml(x, [-50, 100, 140, 220, 295, 379, 460, 540, 625, 695, 775, 855, 935], [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); 493 572 }; 494 - GetR = function (a) { 495 - return $SSml(a, [86, 181, 281, 386, 476], [0, 1, 2, 3, 4, 5]); 573 + GetR = function (y) { 574 + return $SSml(y, [86, 181, 281, 386, 476], [0, 1, 2, 3, 4, 5]); 496 575 }; 497 - GetX = function (a) { 498 - return $SEql(a, { 576 + GetX = function (c) { 577 + return $SEql(c, { 499 578 "-2": -50, 500 579 "-1": 100, 501 580 0: 140, ··· 512 591 11: 950, 513 592 }); 514 593 }; 515 - GetY = function (a) { 516 - return $SEql(a, { 517 - 0: 75, 518 - 1: 175, 519 - 2: 270, 520 - 3: 380, 521 - 4: 470, 522 - 5: 575, 523 - }); 594 + GetY = function (r) { 595 + return $SEql(r, { 0: 75, 1: 175, 2: 270, 3: 380, 4: 470, 5: 575 }); 524 596 }; 525 - GetY1Y2 = function (a) { 526 - return $SEql(a, { 597 + GetY1Y2 = function (r) { 598 + return $SEql(r, { 527 599 0: [0, 85], 528 600 1: [86, 180], 529 601 2: [181, 280], ··· 532 604 5: [476, 600], 533 605 }); 534 606 }; 535 - GetX1X2 = function (a) { 536 - return $SEql(a, { 607 + GetX1X2 = function (c) { 608 + return $SEql(c, { 537 609 "-2": [-100, -49], 538 610 "-1": [-50, 99], 539 611 0: [100, 139], ··· 555 627 let columnWidth = 170; 556 628 return [Math.floor(pixelX / rowWidth) + 1, Math.floor(pixelY / columnWidth) + 1]; 557 629 }; 558 - !oS.InitLawnMower && 559 - (oS.InitLawnMower = function () { 560 - var a = 6; 561 - while (--a) { 562 - CustomSpecial(oLawnCleaner, a, -1); 563 - } 564 - }); 630 + if (!oS.InitLawnMower) { 631 + oS.InitLawnMower = function () { 632 + let r = 6; 633 + while (--r) CustomSpecial(oLawnCleaner, r, -1); 634 + }; 635 + } 565 636 oS.GifHTML = ""; 566 637 }, 638 + // 6-Row Layout (Pool) 567 639 2() { 568 640 oS.R = 6; 569 - ChosePlantX = function (a) { 570 - return Compare(GetC(a), 1, oS.C, GetX); 641 + ChosePlantX = function (x) { 642 + return Compare(GetC(x), 1, oS.C, GetX); 571 643 }; 572 - ChosePlantY = function (a) { 644 + ChosePlantY = function (y) { 573 645 return $SSml( 574 - a, 646 + y, 575 647 [86, 171, 264, 368, 440, 532], 576 648 [ 577 649 [75, 0], ··· 584 656 ] 585 657 ); 586 658 }; 587 - GetC = function (a) { 588 - return $SSml(a, [-50, 100, 140, 220, 295, 379, 460, 540, 625, 695, 775, 855, 935], [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); 659 + GetC = function (x) { 660 + return $SSml(x, [-50, 100, 140, 220, 295, 379, 460, 540, 625, 695, 775, 855, 935], [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); 589 661 }; 590 - GetR = function (a) { 591 - return $SSml(a, [86, 171, 264, 368, 440, 532], [0, 1, 2, 3, 4, 5, 6]); 662 + GetR = function (y) { 663 + return $SSml(y, [86, 171, 264, 368, 440, 532], [0, 1, 2, 3, 4, 5, 6]); 592 664 }; 593 - GetX = function (a) { 594 - return $SEql(a, { 665 + GetX = function (c) { 666 + return $SEql(c, { 595 667 "-2": -50, 596 668 "-1": 100, 597 669 0: 140, ··· 608 680 11: 950, 609 681 }); 610 682 }; 611 - GetY = function (a) { 612 - return $SEql(a, { 613 - 0: 75, 614 - 1: 165, 615 - 2: 253, 616 - 3: 355, 617 - 4: 430, 618 - 5: 522, 619 - 6: 587, 620 - }); 683 + GetY = function (r) { 684 + return $SEql(r, { 0: 75, 1: 165, 2: 253, 3: 355, 4: 430, 5: 522, 6: 587 }); 621 685 }; 622 - GetY1Y2 = function (a) { 623 - return $SEql(a, { 686 + GetY1Y2 = function (r) { 687 + return $SEql(r, { 624 688 0: [0, 85], 625 689 1: [86, 170], 626 690 2: [171, 263], ··· 630 694 6: [532, 600], 631 695 }); 632 696 }; 633 - GetX1X2 = function (a) { 634 - return $SEql(a, { 697 + GetX1X2 = function (c) { 698 + return $SEql(c, { 635 699 "-2": [-100, -49], 636 700 "-1": [-50, 99], 637 701 0: [100, 139], ··· 648 712 11: [950, 1030], 649 713 }); 650 714 }; 651 - !oS.InitLawnMower && 652 - (oS.InitLawnMower = function () { 715 + if (!oS.InitLawnMower) { 716 + oS.InitLawnMower = function () { 653 717 CustomSpecial(oLawnCleaner, 1, -1); 654 718 CustomSpecial(oLawnCleaner, 2, -1); 655 719 CustomSpecial(oPoolCleaner, 3, -1); 656 720 CustomSpecial(oPoolCleaner, 4, -1); 657 721 CustomSpecial(oLawnCleaner, 5, -1); 658 722 CustomSpecial(oLawnCleaner, 6, -1); 659 - }); 723 + }; 724 + } 660 725 oS.GifHTML = '<img style="position:absolute;left:253px;top:278px" src="">'; 661 - !oS.DKind && oGd.MakeFog(); 726 + if (!oS.DKind) oGd.MakeFog(); 662 727 }, 663 728 }; 729 + 664 730 var oP = { 665 - Init(a) { 666 - var r = this; 667 - r.NumZombies = r.FlagZombies = 0; 668 - if (a) { 669 - var l; 670 - for (l in a) { 671 - r[l] = a[l]; 731 + Init(config) { 732 + const self = this; 733 + self.NumZombies = self.FlagZombies = 0; 734 + self.AZ = []; 735 + self.ArZ = []; 736 + self.MustShowAtFlag = {}; 737 + if (config) { 738 + for (let key in config) { 739 + self[key] = config[key]; 672 740 } 673 - if (a.AZ) { 674 - var k; 675 - var b = {}; 676 - var g; 677 - var c; 678 - var q; 679 - var p; 680 - var d; 681 - var m = []; 682 - var h; 683 - var e; 684 - var n; 685 - r.ArZ = []; 686 - h = (k = r.AZ).sort((i, f) => { 687 - return i[2] - f[2]; 688 - }).length; 689 - while (h--) { 690 - c = (n = k[h])[0]; 691 - q = n[1]; 692 - p = n[2]; 693 - while (q--) { 694 - m.push([c, p]); 741 + if (config.AZ) { 742 + // Parse AZ (Array Zombies) configuration 743 + let rawAZ = config.AZ; 744 + let schedule = {}; 745 + let azList = []; 746 + let i = rawAZ.sort((a, b) => a[2] - b[2]).length; 747 + 748 + while (i--) { 749 + let entry = rawAZ[i]; 750 + let zombieType = entry[0]; 751 + let count = entry[1]; 752 + let weight = entry[2]; 753 + let flags = entry[3]; 754 + 755 + while (count--) { 756 + azList.push([zombieType, weight]); 695 757 } 696 - if ((d = n[3])) { 697 - e = d.length; 698 - while (e--) { 699 - b[(g = d[e])] ? b[g].push(c) : (b[g] = [c]); 758 + if (flags) { 759 + let fLen = flags.length; 760 + while (fLen--) { 761 + let flagNum = flags[fLen]; 762 + schedule[flagNum] ? schedule[flagNum].push(zombieType) : (schedule[flagNum] = [zombieType]); 700 763 } 701 764 } 702 765 } 703 - r.AZ = m; 704 - r.MustShowAtFlag = b; 766 + self.AZ = azList; 767 + self.MustShowAtFlag = schedule; 705 768 } 706 769 } 707 - a && a.FlagNum 708 - ? ((r.FlagHeadStep = Math.floor(140 / (a.FlagNum - 1))), 709 - (r.MonPrgs = function () { 710 - var u = oP; 711 - var j; 712 - var i = u.FlagZombies; 713 - var s; 714 - var t; 715 - var f = $User.Visitor; 716 - !--u.NumZombies && 717 - (i < u.FlagNum 718 - ? ((u.ReadyFlag = ++i), oSym.addTask(500, u.FlagPrgs, [])) 719 - : (u.FlagToEnd(), 720 - $User.isAuthorWebsite && 721 - $User.Visitor.UserName !== "" && 722 - (ClearChild($("JSPVZAjax")), f.SaveLvl && NewEle("JSPVZAjax", "script", 0, {}, document.body)), 723 - f.SaveLvlCallBack && 724 - f.SaveLvlCallBack({ 725 - UserName: f.UserName, 726 - SunNum: oS.SunNum, 727 - Lvl: s, 728 - T: oSym.Now - oS.StartTime, 729 - }), 730 - !isNaN(Math.floor(s)) && 731 - ((t = $("dAdventure")), 732 - ($User.Visitor.Progress = ++s), 733 - (t.firstChild.innerHTML = Math.ceil(s / 10)), 734 - (t.childNodes[1].innerHTML = (s -= Math.floor(s / 10) * 10) ? s : s + 1)), 735 - NewEle( 736 - "DivA", 737 - "div", 738 - "position:absolute;width:900px;height:600px;background:#FFF;filter:alpha(opacity=0);opacity:0;z-index:255", 739 - 0, 740 - EDAll 741 - ), 742 - PauseGame($("dMenu0"), 1))); 743 - })) 744 - : (r.MonPrgs = function () {}); 745 - (!a || !a.FlagToEnd) && 746 - (r.FlagToEnd = function () { 770 + 771 + if (config && config.FlagNum) { 772 + self.FlagHeadStep = Math.floor(140 / (config.FlagNum - 1)); 773 + self.MonPrgs = function () { 774 + const p = oP; 775 + let curFlag = p.FlagZombies; 776 + const user = $User.Visitor; 777 + 778 + if (!--p.NumZombies) { 779 + if (curFlag < p.FlagNum) { 780 + p.ReadyFlag = ++curFlag; 781 + oSym.addTask(500, p.FlagPrgs, []); 782 + } else { 783 + p.FlagToEnd(); 784 + if ($User.isAuthorWebsite && $User.Visitor.UserName !== "") { 785 + ClearChild($("JSPVZAjax")); 786 + if (user.SaveLvl) { 787 + NewEle("JSPVZAjax", "script", 0, {}, document.body); 788 + } 789 + } 790 + if (user.SaveLvlCallBack) { 791 + user.SaveLvlCallBack({ 792 + UserName: user.UserName, 793 + SunNum: oS.SunNum, 794 + Lvl: oS.Lvl, 795 + T: oSym.Now - oS.StartTime, 796 + }); 797 + } 798 + 799 + // Update Progress Display 800 + if (!isNaN(Math.floor(oS.Lvl))) { 801 + let advDiv = $("dAdventure"); 802 + $User.Visitor.Progress = ++oS.Lvl; 803 + if (advDiv && advDiv.firstChild && advDiv.childNodes && advDiv.childNodes[1]) { 804 + advDiv.firstChild.innerHTML = Math.ceil(oS.Lvl / 10); 805 + let subLvl = oS.Lvl - Math.floor(oS.Lvl / 10) * 10; 806 + advDiv.childNodes[1].innerHTML = subLvl ? subLvl : subLvl + 1; 807 + } 808 + } 809 + 810 + NewEle( 811 + "DivA", 812 + "div", 813 + "position:absolute;width:900px;height:600px;background:#FFF;filter:alpha(opacity=0);opacity:0;z-index:255", 814 + 0, 815 + EDAll 816 + ); 817 + PauseGame($("dMenu0"), 1); 818 + } 819 + } 820 + }; 821 + } else { 822 + self.MonPrgs = function () {}; 823 + } 824 + 825 + if (!config || !config.FlagToEnd) { 826 + self.FlagToEnd = function () { 747 827 NewImg("imgSF", "images/interface/trophy.png", "left:417px;top:233px;z-index:255", EDAll, { 748 828 onclick() { 749 829 PlayAudio("winmusic"); ··· 753 833 ShowNameDiv(); 754 834 }, 755 835 }); 756 - }); 836 + }; 837 + } 757 838 }, 758 839 Balloon() { 759 840 let balloonId = Math.floor(1 + Math.random() * 1000); ··· 785 866 const timeInSec = (ms) => ms / 100; 786 867 const toTicks = (ms) => Math.round(ms / timeStep); 787 868 788 - oP.balloonStyleSheet.insertRule( 789 - ` 790 - @keyframes moveLeft${balloonId} { 791 - from { left: 910px; } 792 - to { left: -75px; } 793 - } 794 - `, 795 - oP.balloonStyleSheet.cssRules.length 796 - ); 869 + oP.balloonStyleSheet.insertRule(`@keyframes moveLeft${balloonId} { from { left: 910px; } to { left: -75px; } }`, oP.balloonStyleSheet.cssRules.length); 797 870 798 871 oP.balloonStyleSheet.insertRule( 799 - ` 800 - @keyframes bobbing${balloonId} { 801 - 0%, 100% { top: ${randomY}px; } 802 - 50% { top: ${randomY + 10}px; } 803 - } 804 - `, 872 + `@keyframes bobbing${balloonId} { 0%, 100% { top: ${randomY}px; } 50% { top: ${randomY + 10}px; } }`, 805 873 oP.balloonStyleSheet.cssRules.length 806 874 ); 807 875 808 876 let image = document.createElement("div"); 809 877 image.style = ` 810 - background-image: url(images/Zombies/Balloon/balloonidle.png); 811 - position: absolute; 812 - display: block; 813 - left: 875px; 814 - top: ${randomY}px; 815 - z-index: 999; 816 - width: 154px; 817 - height: 181px; 818 - scale: 0.6038961039; 819 - cursor: url(images/interface/Pointer.cur),pointer; 820 - animation: 821 - spritesheetIdle ${timeInSec(timeStep * 10)}s steps(30) infinite, 822 - moveLeft${balloonId} ${timeInSec(timeStep * 130)}s linear, 823 - bobbing${balloonId} ${timeInSec(timeStep * 20)}s ease-in-out infinite; 824 - `; 878 + background-image: url(images/Zombies/Balloon/balloonidle.png); 879 + position: absolute; 880 + display: block; 881 + left: 875px; 882 + top: ${randomY}px; 883 + z-index: 999; 884 + width: 154px; 885 + height: 181px; 886 + scale: 0.6038961039; 887 + cursor: url(images/interface/Pointer.cur),pointer; 888 + animation: 889 + spritesheetIdle ${timeInSec(timeStep * 10)}s steps(30) infinite, 890 + moveLeft${balloonId} ${timeInSec(timeStep * 130)}s linear, 891 + bobbing${balloonId} ${timeInSec(timeStep * 20)}s ease-in-out infinite; 892 + `; 825 893 826 894 $("dPZ").appendChild(image); 827 895 828 896 image.onclick = function () { 829 897 image.onclick = null; 830 898 image.style = ` 831 - background-image: url(images/Zombies/Balloon/popped.png); 832 - position: absolute; 833 - display: block; 834 - left: ${getAnimatedPosition(image).left}px; 835 - top: ${randomY}px; 836 - z-index: 999; 837 - width: 154px; 838 - height: 181px; 839 - scale: 0.6038961039; 840 - pointer-events: none; 841 - animation: spritesheetPop ${timeInSec(timeStep * 10)}s 1 normal forwards steps(21); 842 - `; 899 + background-image: url(images/Zombies/Balloon/popped.png); 900 + position: absolute; 901 + display: block; 902 + left: ${getAnimatedPosition(image).left}px; 903 + top: ${randomY}px; 904 + z-index: 999; 905 + width: 154px; 906 + height: 181px; 907 + scale: 0.6038961039; 908 + pointer-events: none; 909 + animation: spritesheetPop ${timeInSec(timeStep * 10)}s 1 normal forwards steps(21); 910 + `; 843 911 844 912 image.addEventListener("animationend", () => { 845 913 if (endMode === "endOfAnimation") { 846 914 image.style = ` 847 - background-image: url(images/Zombies/Balloon/popped.png); 848 - background-position-x: -3080px; 849 - position: absolute; 850 - display: block; 851 - left: ${getAnimatedPosition(image).left}px; 852 - top: ${randomY}px; 853 - z-index: 999; 854 - width: 154px; 855 - height: 181px; 856 - scale: 0.6038961039; 857 - pointer-events: none; 858 - `; 915 + background-image: url(images/Zombies/Balloon/popped.png); 916 + background-position-x: -3080px; 917 + position: absolute; 918 + display: block; 919 + left: ${getAnimatedPosition(image).left}px; 920 + top: ${randomY}px; 921 + z-index: 999; 922 + width: 154px; 923 + height: 181px; 924 + scale: 0.6038961039; 925 + pointer-events: none; 926 + `; 859 927 endMode = "remove"; 860 928 } else { 861 929 image.parentNode.removeChild(image); ··· 888 956 if (Math.floor(Math.random() * 5) === 1 && $("dSunNum").style.visibility === "") { 889 957 oP.Balloon(); 890 958 } 891 - var g = oP; 892 - var c = oS.LargeWaveFlag; 893 - var e; 894 - var b = g.FlagHeadStep; 895 - var a = g.FlagNum; 959 + const self = oP; 960 + const largeFlags = oS.LargeWaveFlag; 961 + const step = self.FlagHeadStep; 962 + const totalFlags = self.FlagNum; 963 + 896 964 SetVisible($("imgGQJC"), $("dFlagMeterContent")); 897 - for (e in c) { 898 - Math.floor(e) < a 899 - ? SetStyle(c[e], { 965 + 966 + for (let flagIdx in largeFlags) { 967 + Math.floor(flagIdx) < totalFlags 968 + ? SetStyle(largeFlags[flagIdx], { 900 969 visibility: "visible", 901 - left: 150 - (e - 1) * b + "px", 970 + left: 150 - (flagIdx - 1) * step + "px", 902 971 }) 903 - : SetVisible(c[e]); 972 + : SetVisible(largeFlags[flagIdx]); 904 973 } 974 + 905 975 PlayAudio("awooga"); 906 - $User.HTML5 && 907 - (function () { 976 + 977 + if ($User.HTML5) { 978 + (function playGroans() { 908 979 oSym.addTask( 909 980 2e3, 910 981 function () { 911 - [ 912 - function () { 913 - PlayAudio(["groan1", "groan2"][Math.floor(Math.random() * 2)]); 914 - }, 915 - function () { 916 - PlayAudio(["groan3", "groan4"][Math.floor(Math.random() * 2)]); 917 - }, 918 - function () { 919 - PlayAudio(["groan5", "groan6"][Math.floor(Math.random() * 2)]); 920 - }, 921 - function () { 982 + const randomGroan = [ 983 + () => PlayAudio(["groan1", "groan2"][Math.floor(Math.random() * 2)]), 984 + () => PlayAudio(["groan3", "groan4"][Math.floor(Math.random() * 2)]), 985 + () => PlayAudio(["groan5", "groan6"][Math.floor(Math.random() * 2)]), 986 + () => { 922 987 PlayAudio("groan1"); 923 - oSym.addTask( 924 - 150, 925 - () => { 926 - PlayAudio("groan5"); 927 - }, 928 - [] 929 - ); 988 + oSym.addTask(150, () => PlayAudio("groan5"), []); 930 989 }, 931 - function () { 990 + () => { 932 991 PlayAudio("groan2"); 933 - oSym.addTask( 934 - 150, 935 - () => { 936 - PlayAudio("groan6"); 937 - }, 938 - [] 939 - ); 992 + oSym.addTask(150, () => PlayAudio("groan6"), []); 940 993 }, 941 - ][Math.floor(Math.random() * 3)](); 942 - oSym.addTask(2e3, arguments.callee, []); 994 + ][Math.floor(Math.random() * 3)]; 995 + 996 + randomGroan(); 997 + oSym.addTask(2e3, playGroans, []); 943 998 }, 944 999 [] 945 1000 ); 946 1001 })(); 947 - g.ReadyFlag = 1; 948 - g.FlagPrgs(d); 1002 + } 1003 + 1004 + self.ReadyFlag = 1; 1005 + self.FlagPrgs(d); 949 1006 }, 950 - SelectFlagZombie(j, d) { 951 - var e = oP; 952 - var m = e.ArZ; 953 - var k = e.AZ; 954 - var s = k.length; 955 - var q; 956 - var r; 957 - var i = []; 958 - var g = 0; 959 - var n = oS.LargeWaveFlag[d]; 960 - var c = false; 961 - var h = !n ? 150 : (PlayAudio("siren"), (n.style.top = "5px"), --j, (i[g++] = oS.FlagZombie || oFlagZombie), 30); 962 - var p; 963 - var b; 964 - var f = e.MustShowAtFlag; 965 - var a; 966 - while (s--) { 967 - if ((r = (q = k[s])[1]) > d) { 1007 + SelectFlagZombie(totalLvl, flag) { 1008 + const self = oP; 1009 + const az = self.AZ || (self.AZ = []); 1010 + let azLen = az.length; 1011 + const zombiesToSpawn = []; 1012 + let count = 0; 1013 + const isLargeWave = oS.LargeWaveFlag[flag]; 1014 + let remainingLvl = totalLvl; 1015 + 1016 + const delay = !isLargeWave 1017 + ? 150 1018 + : (PlayAudio("siren"), (isLargeWave.style.top = "5px"), --remainingLvl, (zombiesToSpawn[count++] = oS.FlagZombie || oFlagZombie), 30); 1019 + 1020 + const availableZombies = []; 1021 + let hasNew = false; 1022 + 1023 + // Filter zombies available for this wave 1024 + while (azLen--) { 1025 + let entry = az[azLen]; 1026 + let entryFlag = entry[1]; 1027 + if (entryFlag > flag) { 968 1028 break; 969 1029 } else { 970 - m.push(q[0]); 971 - --k.length; 972 - c = true; 1030 + availableZombies.push(entry[0]); 1031 + --az.length; 1032 + hasNew = true; 973 1033 } 974 1034 } 975 - c && 976 - m.sort((t, l) => { 977 - return t.prototype.Lvl - l.prototype.Lvl; 978 - }); 979 - if ((a = f[d])) { 980 - s = a.length; 981 - while (s--) { 982 - j -= (i[g++] = a[s]).prototype.Lvl; 1035 + 1036 + if (hasNew) { 1037 + if (!self.ArZ) self.ArZ = []; 1038 + self.ArZ.push(...availableZombies); 1039 + self.ArZ.sort((a, b) => a.prototype.Lvl - b.prototype.Lvl); 1040 + } 1041 + 1042 + // Add forced zombies for this flag 1043 + const forcedMap = self.MustShowAtFlag || (self.MustShowAtFlag = {}); 1044 + const forced = forcedMap[flag]; 1045 + if (forced) { 1046 + let fLen = forced.length; 1047 + while (fLen--) { 1048 + remainingLvl -= (zombiesToSpawn[count++] = forced[fLen]).prototype.Lvl; 983 1049 } 984 1050 } 985 - b = m[(s = (p = m.length) - 1)].prototype.Lvl; 986 - while (j > 0) { 987 - if (s && b > j) { 988 - while (--s && m[s].prototype.Lvl > j) {} 989 - p = s + 1; 990 - b = m[s].prototype.Lvl; 1051 + 1052 + // Fill remaining level with random zombies 1053 + let zombiePool = self.ArZ; 1054 + if (!zombiePool || zombiePool.length === 0) { 1055 + zombiePool = self.ArZ = oS.ZName && oS.ZName.slice ? oS.ZName.slice(0) : []; 1056 + if (zombiePool.length) zombiePool.sort((a, b) => a.prototype.Lvl - b.prototype.Lvl); 1057 + } 1058 + if (!zombiePool.length) { 1059 + // No available zombies configured; avoid throwing. 1060 + return; 1061 + } 1062 + let poolLen = zombiePool.length; 1063 + let maxIdx = poolLen - 1; 1064 + let maxLvl = zombiePool[maxIdx].prototype.Lvl; 1065 + 1066 + while (remainingLvl > 0) { 1067 + if (maxIdx && maxLvl > remainingLvl) { 1068 + while (--maxIdx && zombiePool[maxIdx].prototype.Lvl > remainingLvl) {} 1069 + poolLen = maxIdx + 1; 1070 + maxLvl = zombiePool[maxIdx].prototype.Lvl; 991 1071 } 992 - j -= (i[g++] = m[Math.floor(Math.random() * p)]).prototype.Lvl; 1072 + remainingLvl -= (zombiesToSpawn[count++] = zombiePool[Math.floor(Math.random() * poolLen)]).prototype.Lvl; 993 1073 } 994 - e.NumZombies += g; 995 - e.SetTimeoutZombie(i, h); 1074 + 1075 + self.NumZombies += count; 1076 + self.SetTimeoutZombie(zombiesToSpawn, delay); 996 1077 }, 997 - SelectFlagZombie1(d) { 998 - var h = oP; 999 - var c = []; 1000 - var a = 0; 1001 - var g = h.ArZ; 1002 - var f = oS.LargeWaveFlag[h.FlagZombies]; 1003 - var e = h.SumToZombie; 1004 - var b = !f ? 150 : ((f.style.top = "5px"), --d, (c[a++] = oS.FlagZombie || oFlagZombie), 30); 1005 - while (d > 0) { 1006 - d -= (c[a++] = g[Math.floor(Math.random() * $SEql(d, e))]).prototype.Lvl; 1078 + SelectFlagZombie1(lvl) { 1079 + const self = oP; 1080 + const zombies = []; 1081 + let count = 0; 1082 + const pool = self.ArZ; 1083 + const isLargeWave = oS.LargeWaveFlag[self.FlagZombies]; 1084 + const sumToZombie = self.SumToZombie; 1085 + const delay = !isLargeWave ? 150 : ((isLargeWave.style.top = "5px"), --lvl, (zombies[count++] = oS.FlagZombie || oFlagZombie), 30); 1086 + 1087 + while (lvl > 0) { 1088 + lvl -= (zombies[count++] = pool[Math.floor(Math.random() * $SEql(lvl, sumToZombie))]).prototype.Lvl; 1007 1089 } 1008 - h.NumZombies += a; 1009 - h.SetTimeoutZombie(c, b); 1090 + self.NumZombies += count; 1091 + self.SetTimeoutZombie(zombies, delay); 1010 1092 }, 1011 - SetTimeoutTomZombie(c) { 1012 - var f = []; 1013 - var d = []; 1014 - var e = 0; 1015 - var a = c.length; 1016 - var b; 1017 - var g; 1018 - for (b in oGd.$Tombstones) { 1019 - g = b.split("_"); 1020 - d[e] = (f[e] = new c[Math.floor(Math.random() * a)]()).CustomBirth(g[0], g[1], 100); 1021 - ++e; 1093 + SetTimeoutTomZombie(classes) { 1094 + const zombieList = []; 1095 + const protoList = []; 1096 + let count = 0; 1097 + const classLen = classes.length; 1098 + 1099 + for (let key in oGd.$Tombstones) { 1100 + let coords = key.split("_"); 1101 + let zombie = new classes[Math.floor(Math.random() * classLen)](); 1102 + protoList[count] = zombie; 1103 + zombieList[count] = zombie.CustomBirth(coords[0], coords[1], 100); 1104 + ++count; 1022 1105 } 1023 - this.AppearUP(d, f, e); 1106 + this.AppearUP(zombieList, protoList, count); 1024 1107 }, 1025 - SetTimeoutWaterZombie(j, b, e, h) { 1026 - var f = oGd.$LF; 1027 - var l = []; 1028 - var c = f.length; 1029 - var m = []; 1030 - var k = []; 1031 - var g = h.length; 1032 - var a; 1033 - var d = b - j + 1; 1034 - while (--c) { 1035 - f[c] === 2 && l.push(c); 1108 + SetTimeoutWaterZombie(rowStart, rowEnd, count, classes) { 1109 + const laneTypes = oGd.$LF; 1110 + const validRows = []; 1111 + let i = laneTypes.length; 1112 + while (--i) { 1113 + if (laneTypes[i] === 2) validRows.push(i); 1036 1114 } 1037 - a = l.length; 1038 - c = e; 1115 + 1116 + const rowLen = validRows.length; 1117 + const zombies = []; 1118 + const protos = []; 1119 + const classLen = classes.length; 1120 + const range = rowEnd - rowStart + 1; 1121 + 1122 + let c = count; 1039 1123 while (c--) { 1040 - k[c] = (m[c] = new h[Math.floor(Math.random() * g)]()).CustomBirth(l[Math.floor(Math.random() * a)], Math.floor(j + Math.random() * d)); 1124 + let zombie = new classes[Math.floor(Math.random() * classLen)](); 1125 + protos[c] = zombie; 1126 + zombies[c] = zombie.CustomBirth(validRows[Math.floor(Math.random() * rowLen)], Math.floor(rowStart + Math.random() * range)); 1041 1127 } 1042 - this.AppearUP(k, m, e); 1128 + this.AppearUP(zombies, protos, count); 1043 1129 }, 1044 - AppearUP(a, c, b) { 1045 - oP.NumZombies += b; 1130 + AppearUP(htmlList, objList, count) { 1131 + oP.NumZombies += count; 1046 1132 asyncInnerHTML( 1047 - a.join(""), 1048 - (h, f) => { 1049 - EDPZ.appendChild(h); 1050 - var e = f.length; 1051 - var g; 1052 - var d; 1053 - while (e--) { 1054 - g = f[e]; 1055 - g.Birth.call(g); 1056 - SetBlock(g.Ele); 1133 + htmlList.join(""), 1134 + (fragment, list) => { 1135 + EDPZ.appendChild(fragment); 1136 + let i = list.length; 1137 + while (i--) { 1138 + let zombie = list[i]; 1139 + zombie.Birth.call(zombie); 1140 + SetBlock(zombie.Ele); 1057 1141 oSym.addTask( 1058 1142 10, 1059 - function (l, k, i, j) { 1060 - k = Math.max(k - j, 0); 1061 - SetStyle(l, { 1062 - top: k + "px", 1063 - clip: "rect(0,auto," + (i += j) + "px,0)", 1143 + function (ele, top, clipHeight, step) { 1144 + top = Math.max(top - step, 0); 1145 + SetStyle(ele, { 1146 + top: top + "px", 1147 + clip: "rect(0,auto," + (clipHeight += step) + "px,0)", 1064 1148 }); 1065 - k && oSym.addTask(10, arguments.callee, [l, k, i, j]); 1149 + if (top) oSym.addTask(10, arguments.callee, [ele, top, clipHeight, step]); 1066 1150 }, 1067 - [g.EleBody, (d = g.height), 0, d * 0.1] 1151 + [zombie.EleBody, zombie.height, 0, zombie.height * 0.1] 1068 1152 ); 1069 1153 } 1070 1154 }, 1071 - c 1155 + objList 1072 1156 ); 1073 1157 }, 1074 - SetZombie(j, b, e, h) { 1075 - var f = []; 1076 - var l = []; 1077 - var c = f.length; 1078 - var m = []; 1079 - var k = []; 1080 - var g = h.length; 1081 - var a; 1082 - var d = b - j + 1; 1083 - while (--c) { 1084 - f[c] === 2 && l.push(c); 1158 + SetZombie(rowStart, rowEnd, count, classes) { 1159 + // Redundant with SetTimeoutWaterZombie but keeping for legacy compatibility 1160 + const laneTypes = []; 1161 + const validRows = []; 1162 + let i = laneTypes.length; 1163 + // Logic seems broken in original script (f undefined), fixing assumption it uses oGd.$LF 1164 + const realLanes = oGd.$LF; 1165 + let j = realLanes.length; 1166 + while (--j) { 1167 + if (realLanes[j] === 2) validRows.push(j); 1085 1168 } 1086 - a = l.length; 1087 - c = e; 1169 + 1170 + const rowLen = validRows.length; 1171 + const zombies = []; 1172 + const protos = []; 1173 + const classLen = classes.length; 1174 + const range = rowEnd - rowStart + 1; 1175 + 1176 + let c = count; 1088 1177 while (c--) { 1089 - k[c] = (m[c] = new h[Math.floor(Math.random() * g)]()).CustomBirth(l[Math.floor(Math.random() * a)], Math.floor(j + Math.random() * d)); 1178 + let zombie = new classes[Math.floor(Math.random() * classLen)](); 1179 + protos[c] = zombie; 1180 + zombies[c] = zombie.CustomBirth(validRows[Math.floor(Math.random() * rowLen)], Math.floor(rowStart + Math.random() * range)); 1090 1181 } 1091 - this.AppearUP1(k, m, e); 1182 + this.AppearUP1(zombies, protos, count); 1092 1183 }, 1093 - AppearUP1(a, c, b) { 1094 - oP.NumZombies += b; 1184 + AppearUP1(htmlList, objList, count) { 1185 + oP.NumZombies += count; 1095 1186 asyncInnerHTML( 1096 - a.join(""), 1097 - (h, f) => { 1098 - EDPZ.appendChild(h); 1099 - var e = f.length; 1100 - var g; 1101 - var d; 1102 - while (e--) { 1103 - g = f[e]; 1104 - g.Birth.call(g); 1105 - SetBlock(g.Ele); 1187 + htmlList.join(""), 1188 + (fragment, list) => { 1189 + EDPZ.appendChild(fragment); 1190 + let i = list.length; 1191 + while (i--) { 1192 + let zombie = list[i]; 1193 + zombie.Birth.call(zombie); 1194 + SetBlock(zombie.Ele); 1106 1195 oSym.addTask( 1107 1196 10, 1108 - function (l, k, i, j) { 1109 - k = Math.max(k - j, 0); 1110 - SetStyle(l, { 1111 - top: k + "px", 1112 - clip: "rect(0,auto," + (i += j) + "px,0)", 1197 + function (ele, top, clipHeight, step) { 1198 + top = Math.max(top - step, 0); 1199 + SetStyle(ele, { 1200 + top: top + "px", 1201 + clip: "rect(0,auto," + (clipHeight += step) + "px,0)", 1113 1202 }); 1114 - k && oSym.addTask(10, arguments.callee, [l, k, i, j]); 1203 + if (top) oSym.addTask(10, arguments.callee, [ele, top, clipHeight, step]); 1115 1204 }, 1116 - [g.EleBody, (d = g.height), 0, d * 0.1] 1205 + [zombie.EleBody, zombie.height, 0, zombie.height * 0.1] 1117 1206 ); 1118 1207 } 1119 1208 }, 1120 - c 1209 + objList 1121 1210 ); 1122 1211 }, 1123 - SetTimeoutZombie(b, d) { 1124 - var f = []; 1125 - var c = []; 1126 - var e = 0; 1127 - var g = 0; 1128 - var a = b.length; 1129 - while (e < a) { 1130 - c[e] = (f[e] = new b[e]()).prepareBirth(g); 1131 - g += d; 1132 - ++e; 1212 + SetTimeoutZombie(zombieList, delay) { 1213 + const htmlBuffer = []; 1214 + const zombieObjs = []; 1215 + let idx = 0; 1216 + let timeOffset = 0; 1217 + const len = zombieList.length; 1218 + 1219 + while (idx < len) { 1220 + const zombie = new zombieList[idx](); 1221 + htmlBuffer[idx] = zombie.prepareBirth(timeOffset); 1222 + zombieObjs[idx] = zombie; 1223 + timeOffset += delay; 1224 + ++idx; 1133 1225 } 1226 + 1134 1227 asyncInnerHTML( 1135 - c.join(""), 1136 - (k, j) => { 1137 - EDPZ.appendChild(k); 1138 - var h = j.length; 1139 - while (h--) { 1140 - j[h].Birth(); 1228 + htmlBuffer.join(""), 1229 + (fragment, list) => { 1230 + EDPZ.appendChild(fragment); 1231 + let i = list.length; 1232 + while (i--) { 1233 + list[i].Birth(); 1141 1234 } 1142 1235 }, 1143 - f 1236 + zombieObjs 1144 1237 ); 1145 1238 }, 1146 1239 FlagPrgs() { 1147 - var f = oP; 1148 - var c = f.FlagZombies; 1149 - var e = f.FlagToSumNum; 1150 - var a = 139 - c * f.FlagHeadStep; 1151 - var d = $SSml(c, e.a1, e.a2); 1152 - var b; 1153 - f.FlagNum > (c = ++f.FlagZombies) 1154 - ? (($("imgFlagHead").style.left = a + "px"), 1155 - ($("imgFlagMeterFull").style.clip = "rect(0,157px,21px," + (a + 11) + "px)"), 1156 - (b = $SEql(c, f.FlagToMonitor)) && 1157 - oSym.addTask( 1158 - 1690, 1159 - (g) => { 1160 - !g[1] && (g[0](), (g[1] = 1)); 1161 - }, 1162 - [b] 1163 - ), 1240 + const self = oP; 1241 + let curFlag = self.FlagZombies; 1242 + const flagSum = self.FlagToSumNum; 1243 + const headPos = 139 - curFlag * self.FlagHeadStep; 1244 + const lvl = $SSml(curFlag, flagSum.a1, flagSum.a2); 1245 + 1246 + if (self.FlagNum > (curFlag = ++self.FlagZombies)) { 1247 + $("imgFlagHead").style.left = headPos + "px"; 1248 + $("imgFlagMeterFull").style.clip = "rect(0,157px,21px," + (headPos + 11) + "px)"; 1249 + 1250 + // Monitor Flag 1251 + let monitorFunc = $SEql(curFlag, self.FlagToMonitor); 1252 + if (monitorFunc) { 1164 1253 oSym.addTask( 1165 - 1990, 1166 - (g) => { 1167 - var h = oP; 1168 - h.ReadyFlag === g++ && ((h.ReadyFlag = g), h.FlagPrgs()); 1254 + 1690, 1255 + (args) => { 1256 + if (!args[1]) { 1257 + args[0](); 1258 + args[1] = 1; 1259 + } 1169 1260 }, 1170 - [c] 1171 - )) 1172 - : (($("imgFlagHead").style.left = "-1px"), ($("imgFlagMeterFull").style.clip = "rect(0,157px,21px,0)")); 1173 - f.SelectFlagZombie.call(f, d, c); 1174 - f.UserDefinedFlagFunc && f.UserDefinedFlagFunc(); 1261 + [monitorFunc] 1262 + ); 1263 + } 1264 + 1265 + oSym.addTask( 1266 + 1990, 1267 + (flag) => { 1268 + const p = oP; 1269 + if (p.ReadyFlag === flag++) { 1270 + p.ReadyFlag = flag; 1271 + p.FlagPrgs(); 1272 + } 1273 + }, 1274 + [curFlag] 1275 + ); 1276 + } else { 1277 + $("imgFlagHead").style.left = "-1px"; 1278 + $("imgFlagMeterFull").style.clip = "rect(0,157px,21px,0)"; 1279 + } 1280 + 1281 + self.SelectFlagZombie.call(self, lvl, curFlag); 1282 + if (self.UserDefinedFlagFunc) self.UserDefinedFlagFunc(); 1175 1283 }, 1176 - Monitor(a, b) { 1177 - a && a.f.apply(a.f, a.ar); 1178 - oP.UserDefinedFlagFunc = b ? b : null; 1179 - (function () { 1284 + Monitor(config, userFunc) { 1285 + if (config) config.f.apply(config.f, config.ar); 1286 + oP.UserDefinedFlagFunc = userFunc ? userFunc : null; 1287 + 1288 + (function loop() { 1180 1289 oZ.traversalOf(); 1181 - oSym.addTask(10, arguments.callee, []); 1290 + oSym.addTask(10, loop, []); 1182 1291 })(); 1183 1292 }, 1184 1293 }; 1294 + 1185 1295 var oGd = { 1186 1296 Init() { 1187 1297 this.$ = []; ··· 1196 1306 this.$Balloon = new Array(oS.R + 1); 1197 1307 this.$Fog = []; 1198 1308 }, 1199 - add(c, a, b, d) { 1200 - (b = (d = this.$)[a]) && b.Die(); 1201 - d[a] = c; 1309 + add(obj, c, r, dict) { 1310 + let old = (dict = this.$)[c]; 1311 + if (old) old.Die(); 1312 + dict[c] = obj; 1202 1313 }, 1203 - del(a) { 1204 - delete this.$[a.R + "_" + a.C + "_" + a.PKind]; 1314 + del(obj) { 1315 + delete this.$[obj.R + "_" + obj.C + "_" + obj.PKind]; 1205 1316 }, 1206 1317 MakeFog() { 1207 - var d = ""; 1208 - var g = (tx = ri = cj = 0); 1209 - var c = oGd.$Fog; 1210 - var b; 1211 - var a = 2 * oS.HaveFog + 3; 1212 - var e = (function () { 1213 - return function (f) { 1214 - var h = $User.Browser.IE && !$User.Browser.IE9; 1215 - d += 1216 - '<img id="' + 1217 - f + 1218 - '" src="images/interface/fog' + 1219 - Math.floor(Math.random() * 4) + 1220 - "." + 1221 - (h ? "gif" : "png") + 1222 - '" style="left:' + 1223 - g + 1224 - "px;top:" + 1225 - tx + 1226 - 'px">'; 1227 - }; 1228 - })(); 1229 - for (ri = 1, tx = 0; ri < 7; g = 0, ri++) { 1230 - for (ci = 0; ci <= a; ci++) { 1231 - e((c[(b = ri + "_" + ci)] = "Fog" + b)); 1232 - g += 35; 1318 + let html = ""; 1319 + let tx = 0, 1320 + ri = 0, 1321 + ci = 0, 1322 + left = 0; 1323 + const fogDict = oGd.$Fog; 1324 + const maxCol = 2 * oS.HaveFog + 3; 1325 + const isIE = $User.Browser.IE && !$User.Browser.IE9; 1326 + 1327 + const addFog = function (id) { 1328 + html += `<img id="${id}" src="images/interface/fog${Math.floor(Math.random() * 4)}.${isIE ? "gif" : "png"}" style="left:${left}px;top:${tx}px">`; 1329 + }; 1330 + 1331 + for (ri = 1, tx = 0; ri < 7; left = 0, ri++) { 1332 + for (ci = 0; ci <= maxCol; ci++) { 1333 + let key = ri + "_" + ci; 1334 + fogDict[key] = "Fog" + key; 1335 + addFog(fogDict[key]); 1336 + left += 35; 1233 1337 } 1234 1338 tx += 90; 1235 1339 } 1236 - NewEle("dFog", "div", "", { innerHTML: d }, EDAll); 1340 + NewEle("dFog", "div", "", { innerHTML: html }, EDAll); 1237 1341 }, 1238 - MoveFogLeft(a) { 1239 - (function (c, d, b, e) { 1240 - d -= 50; 1241 - d > b ? ((c.style.left = d + "px"), oSym.addTask(5, arguments.callee, [c, d, b, e])) : ((c.style.left = b + "px"), e && e()); 1242 - })($("dFog"), 900, GetX(oS.C - oS.HaveFog) - 30, a); 1342 + MoveFogLeft(callback) { 1343 + (function (ele, currentX, limitX, cb) { 1344 + currentX -= 50; 1345 + if (currentX > limitX) { 1346 + ele.style.left = currentX + "px"; 1347 + oSym.addTask(5, arguments.callee, [ele, currentX, limitX, cb]); 1348 + } else { 1349 + ele.style.left = limitX + "px"; 1350 + if (cb) cb(); 1351 + } 1352 + })($("dFog"), 900, GetX(oS.C - oS.HaveFog) - 30, callback); 1243 1353 }, 1244 1354 MoveFogRight() { 1245 - if (arguments.callee.caller.caller == null) { 1246 - return; 1247 - } 1248 - (function (a, b) { 1249 - (b += 50) < 901 ? ((a.style.left = b + "px"), oSym.addTask(5, arguments.callee, [a, b])) : (a.style.left = "900px"); 1355 + if (arguments.callee.caller.caller == null) return; 1356 + (function (ele, currentX) { 1357 + if ((currentX += 50) < 901) { 1358 + ele.style.left = currentX + "px"; 1359 + oSym.addTask(5, arguments.callee, [ele, currentX]); 1360 + } else { 1361 + ele.style.left = "900px"; 1362 + } 1250 1363 })($("dFog"), GetX(oS.C - oS.HaveFog) - 3); 1251 1364 }, 1252 - GatherFog(d, r, x, t, z) { 1253 - var c = d - x; 1254 - var b = d + x; 1255 - var q = r - t; 1256 - var p = r + t; 1257 - var e = [SetNone, SetBlock][z]; 1258 - var w = oS.C; 1259 - var m = oS.R; 1260 - var h = w + 1; 1261 - var g = oS.HaveFog; 1262 - var a = g * 2; 1263 - var k = []; 1264 - var l; 1265 - var j; 1266 - var u; 1267 - var n = function (i) { 1268 - return (i - w) * 2 + a; 1365 + GatherFog(r, c, rRange, cRange, mode) { 1366 + // mode 0 = SetNone (clear), 1 = SetBlock (restore) 1367 + const rowStart = r - rRange; 1368 + const rowEnd = r + rRange; 1369 + const colStart = c - cRange; 1370 + const colEnd = c + cRange; 1371 + const func = [SetNone, SetBlock][mode]; 1372 + 1373 + const cols = oS.C; 1374 + const rows = oS.R; 1375 + const maxCol = cols + 1; 1376 + const fogCount = oS.HaveFog * 2; 1377 + const list = []; 1378 + 1379 + const mapCol = function (i) { 1380 + return (i - cols) * 2 + fogCount; 1269 1381 }; 1270 - var s = function (i) { 1271 - return (i - w) * 2 + a - 2; 1382 + const mapColRev = function (i) { 1383 + return (i - cols) * 2 + fogCount - 2; 1272 1384 }; 1273 - if (c > 0) { 1274 - l = s(q > 0 ? q + 1 : 1); 1275 - j = n(p > h ? h : p - 1); 1385 + 1386 + // Collect fog elements to modify 1387 + let i, j; 1388 + 1389 + if (rowStart > 0) { 1390 + i = mapColRev(colStart > 0 ? colStart + 1 : 1); 1391 + j = mapCol(colEnd > maxCol ? maxCol : colEnd - 1); 1276 1392 do { 1277 - l > -1 && k.push("Fog" + c + "_" + l); 1278 - } while (l++ < j); 1393 + if (i > -1) list.push("Fog" + rowStart + "_" + i); 1394 + } while (i++ < j); 1279 1395 } 1280 - if (b <= m) { 1281 - l = s(q > 0 ? q + 1 : 1); 1282 - j = n(p > h ? h : p - 1); 1396 + 1397 + if (rowEnd <= rows) { 1398 + i = mapColRev(colStart > 0 ? colStart + 1 : 1); 1399 + j = mapCol(colEnd > maxCol ? maxCol : colEnd - 1); 1283 1400 do { 1284 - l > -1 && k.push("Fog" + b + "_" + l); 1285 - } while (l++ < j); 1401 + if (i > -1) list.push("Fog" + rowEnd + "_" + i); 1402 + } while (i++ < j); 1286 1403 } 1287 - ++c; 1288 - --b; 1289 - l = s(q < 1 ? 1 : q); 1290 - j = n(p > h ? h : p); 1291 - u = l; 1292 - do { 1404 + 1405 + let curRow = rowStart + 1; 1406 + let limitRow = rowEnd - 1; 1407 + let startI = mapColRev(colStart < 1 ? 1 : colStart); 1408 + let endJ = mapCol(colEnd > maxCol ? maxCol : colEnd); 1409 + 1410 + while (curRow <= limitRow) { 1411 + i = startI; 1293 1412 do { 1294 - l > -1 && k.push("Fog" + c + "_" + l); 1295 - } while (l++ <= j); 1296 - l = u; 1297 - } while (c++ < b); 1298 - for (l = 0; l < k.length; e($(k[l])), l++) {} 1299 - if (z) { 1300 - var y = oGd.$Torch; 1301 - var f; 1302 - for (u in y) { 1303 - f = $P[y[u]]; 1304 - this.GatherFog(f.R, f.C, 1, 1, 0); 1413 + if (i > -1) list.push("Fog" + curRow + "_" + i); 1414 + } while (i++ <= endJ); 1415 + curRow++; 1416 + } 1417 + 1418 + for (let k = 0; k < list.length; k++) { 1419 + func($(list[k])); 1420 + } 1421 + 1422 + // Recursive clear for Torchwood logic 1423 + if (mode) { 1424 + const torches = oGd.$Torch; 1425 + for (let u in torches) { 1426 + let p = $P[torches[u]]; 1427 + this.GatherFog(p.R, p.C, 1, 1, 0); 1305 1428 } 1306 1429 } 1307 1430 }, 1308 1431 }; 1432 + 1309 1433 var oZ = { 1310 - Init(b) { 1434 + Init(rows) { 1311 1435 this.$ = []; 1312 1436 this.$R = []; 1313 - var a; 1314 - for (a = b; a; this.$[a] = [], this.$R[a--] = []) {} 1437 + let i = rows; 1438 + while (i) { 1439 + this.$[i] = []; 1440 + this.$R[i--] = []; 1441 + } 1315 1442 }, 1316 - add(b, a) { 1317 - (a = oZ.$[b.R]).push(b); 1318 - a.sort((d, c) => { 1319 - return d.AttackedLX - c.AttackedLX; 1320 - }); 1321 - a.RefreshTime = oSym.Now; 1443 + add(zombie, list) { 1444 + list = oZ.$[zombie.R]; 1445 + list.push(zombie); 1446 + list.sort((a, b) => a.AttackedLX - b.AttackedLX); 1447 + list.RefreshTime = oSym.Now; 1322 1448 }, 1323 - getZ0(b, d) { 1324 - if (d < 1 || d > oS.R) { 1325 - return; 1326 - } 1327 - var c = 0; 1328 - var e = this.$[d]; 1329 - var f; 1330 - var a = e.length; 1331 - while (c < a && (f = e[c++]).AttackedLX <= b) { 1332 - if (f.PZ && f.HP && f.AttackedRX >= b) { 1333 - return f; 1449 + getZ0(lx, row) { 1450 + if (row < 1 || row > oS.R) return; 1451 + const list = this.$[row]; 1452 + let i = 0, 1453 + len = list.length, 1454 + zombie; 1455 + while (i < len && (zombie = list[i++]).AttackedLX <= lx) { 1456 + if (zombie.PZ && zombie.HP && zombie.AttackedRX >= lx) { 1457 + return zombie; 1334 1458 } 1335 1459 } 1336 1460 }, 1337 - getZ1(h, b) { 1338 - if (b < 1 || b > oS.R) { 1339 - return; 1461 + getZ1(rx, row) { 1462 + if (row < 1 || row > oS.R) return; 1463 + const list = this.$[row]; 1464 + const rightList = this.$R[row]; 1465 + let sortedList; 1466 + 1467 + if (list.RefreshTime === rightList.RefreshTime) { 1468 + sortedList = rightList; 1469 + } else { 1470 + sortedList = (this.$R[row] = list.slice(0)).sort((a, b) => b.AttackedRX - a.AttackedRX); 1471 + sortedList.RefreshTime = list.RefreshTime; 1340 1472 } 1341 - var d = 0; 1342 - var j = this.$[b]; 1343 - var f = this.$R[b]; 1344 - var g; 1345 - var c; 1346 - var k; 1347 - var e; 1348 - (k = j.RefreshTime) === f.RefreshTime 1349 - ? (g = f) 1350 - : ((g = (this.$R[b] = j.slice(0)).sort((l, i) => { 1351 - return i.AttackedRX - l.AttackedRX; 1352 - })).RefreshTime = k); 1353 - e = g.length; 1354 - while (d < e && (c = g[d++]).AttackedRX >= h) { 1355 - if (c.PZ && c.HP && c.AttackedLX <= h) { 1356 - return c; 1473 + 1474 + let i = 0, 1475 + len = sortedList.length, 1476 + zombie; 1477 + while (i < len && (zombie = sortedList[i++]).AttackedRX >= rx) { 1478 + if (zombie.PZ && zombie.HP && zombie.AttackedLX <= rx) { 1479 + return zombie; 1357 1480 } 1358 1481 } 1359 1482 }, 1360 - getArZ(e, d, b) { 1361 - var g = 0; 1362 - var l = this.$[b]; 1363 - var f = []; 1364 - var k = 0; 1365 - var c; 1366 - var h = l.length; 1367 - var j; 1368 - while (g < h && (j = (c = l[g++]).AttackedLX) < d) { 1369 - c.PZ && c.HP && (j > e || c.AttackedRX > e) && (f[k++] = c); 1483 + getArZ(lx, rx, row) { 1484 + const list = this.$[row]; 1485 + const result = []; 1486 + let i = 0, 1487 + len = list.length, 1488 + zombie, 1489 + zLX; 1490 + while (i < len && (zLX = (zombie = list[i++]).AttackedLX) < rx) { 1491 + if (zombie.PZ && zombie.HP && (zLX > lx || zombie.AttackedRX > lx)) { 1492 + result.push(zombie); 1493 + } 1370 1494 } 1371 - return f; 1495 + return result; 1372 1496 }, 1373 - getRangeLeftZ(e, d, b) { 1374 - if (b < 1 || b > oS.R) { 1375 - return; 1376 - } 1377 - var g = 0; 1378 - var l = this.$[b]; 1379 - var f = []; 1380 - var k = 0; 1381 - var c; 1382 - var h = l.length; 1383 - var j; 1384 - while (g < h && (j = (c = l[g++]).AttackedLX) < d) { 1385 - if (c.PZ && c.HP && (j > e || c.AttackedRX > e)) { 1386 - return c; 1497 + getRangeLeftZ(lx, rx, row) { 1498 + if (row < 1 || row > oS.R) return; 1499 + const list = this.$[row]; 1500 + let i = 0, 1501 + len = list.length, 1502 + zombie, 1503 + zLX; 1504 + while (i < len && (zLX = (zombie = list[i++]).AttackedLX) < rx) { 1505 + if (zombie.PZ && zombie.HP && (zLX > lx || zombie.AttackedRX > lx)) { 1506 + return zombie; 1387 1507 } 1388 1508 } 1389 1509 }, 1390 - moveTo(g, f, c) { 1391 - var b = this.$[f]; 1392 - var a = this.$[c]; 1393 - var e = b.length; 1394 - var d; 1395 - while (e--) { 1396 - (o = b[e]).id === g && 1397 - (b.splice(e, 1), 1398 - (o.R = c), 1399 - a.push(o), 1400 - (a.sort((i, h) => { 1401 - return i.AttackedLX - h.AttackedLX; 1402 - }).RefreshTime = b.RefreshTime = 1403 - oSym.Now), 1404 - (e = 0)); 1510 + moveTo(id, oldR, newR) { 1511 + const oldList = this.$[oldR]; 1512 + const newList = this.$[newR]; 1513 + let i = oldList.length; 1514 + while (i--) { 1515 + let z = oldList[i]; 1516 + if (z.id === id) { 1517 + oldList.splice(i, 1); 1518 + z.R = newR; 1519 + newList.push(z); 1520 + newList.sort((a, b) => a.AttackedLX - b.AttackedLX); 1521 + newList.RefreshTime = oldList.RefreshTime = oSym.Now; 1522 + return; 1523 + } 1405 1524 } 1406 1525 }, 1407 1526 traversalOf() { 1408 - var a; 1409 - var b = this.$; 1410 - var j; 1411 - var l = 0; 1412 - var d = 0; 1413 - var k = 1e3; 1414 - var i; 1415 - var h; 1416 - var f = [ 1417 - function (n) { 1418 - d = 1; 1419 - k = i; 1527 + const zRows = this.$; 1528 + let needsSort = 0; 1529 + let needsRef = 0; 1530 + let maxLX = 1000; 1531 + let curLX; 1532 + 1533 + // Handlers for zombie status 1534 + const handlers = [ 1535 + function (z) { 1536 + // Dead 1537 + needsRef = 1; 1538 + maxLX = curLX; 1420 1539 }, 1421 - function (n) { 1422 - (i = n.AttackedLX) > k && (l = d = 1); 1423 - k = i; 1540 + function (z) { 1541 + // Alive/Moved 1542 + if ((curLX = z.AttackedLX) > maxLX) needsSort = needsRef = 1; 1543 + maxLX = curLX; 1424 1544 }, 1425 1545 ]; 1426 - var e = b.length; 1427 - var m; 1428 - var c; 1429 - var g; 1430 - (function (r) { 1431 - var q = (j = b[r]).length; 1432 - var n = arguments.callee; 1433 - var p = oT.$[r]; 1434 - var s = oT.$L[r]; 1435 - while (q--) { 1436 - a = j[q]; 1437 - a.HP && a.PZ && a.ZX < 901 && oT["chkD" + a.WalkDirection](a, r, p, s); 1438 - !a.HP ? (j.splice(q, 1), f[0](a)) : f[a.ChkActs(a, r, j, q)](a); 1546 + 1547 + // Process rows recursively to avoid blocking 1548 + (function processRow(r) { 1549 + const list = zRows[r]; 1550 + let i = list.length; 1551 + const triggers = oT.$[r]; 1552 + const triggersL = oT.$L[r]; 1553 + 1554 + while (i--) { 1555 + let zombie = list[i]; 1556 + if (zombie.HP && zombie.PZ && zombie.ZX < 901) { 1557 + oT["chkD" + zombie.WalkDirection](zombie, r, triggers, triggersL); 1558 + } 1559 + 1560 + if (!zombie.HP) { 1561 + list.splice(i, 1); 1562 + handlers[0](zombie); 1563 + } else { 1564 + handlers[zombie.ChkActs(zombie, r, list, i)](zombie); 1565 + } 1439 1566 } 1440 - l 1441 - ? ((l = d = 0), 1442 - j.sort((u, t) => { 1443 - return u.AttackedLX - t.AttackedLX; 1444 - }), 1445 - (j.RefreshTime = oSym.Now)) 1446 - : d && ((d = 0), (j.RefreshTime = oSym.Now)); 1447 - --r && oSym.addTask(0, n, [r]); 1448 - })(b.length - 1); 1567 + 1568 + if (needsSort) { 1569 + needsSort = needsRef = 0; 1570 + list.sort((a, b) => a.AttackedLX - b.AttackedLX); 1571 + list.RefreshTime = oSym.Now; 1572 + } else if (needsRef) { 1573 + needsRef = 0; 1574 + list.RefreshTime = oSym.Now; 1575 + } 1576 + 1577 + if (--r) oSym.addTask(0, processRow, [r]); 1578 + })(zRows.length - 1); 1449 1579 }, 1450 1580 }; 1581 + 1451 1582 var oT = { 1452 - Init(b) { 1583 + Init(rows) { 1453 1584 this.$ = []; 1454 1585 this.$L = []; 1455 - for (var a = b; a; ) { 1456 - this.$[a] = []; 1457 - this.$L[a--] = []; 1586 + let i = rows; 1587 + while (i) { 1588 + this.$[i] = []; 1589 + this.$L[i--] = []; 1458 1590 } 1459 1591 }, 1460 - add(f, c, g) { 1461 - if (f <= 0 || f > oS.R) { 1462 - return; 1592 + add(row, triggerBox, id) { 1593 + if (row <= 0 || row > oS.R) return; 1594 + const list = this.$[row]; 1595 + // triggerBox: [left, right, type?, id] 1596 + let i = triggerBox.length; 1597 + while (i--) { 1598 + let t = triggerBox[i]; 1599 + list.push([t[0], t[1], t[2], id]); 1463 1600 } 1464 - var e = this.$[f]; 1465 - var d = c.length; 1466 - var b; 1467 - while (d--) { 1468 - b = c[d]; 1469 - e.push([b[0], b[1], b[2], g]); 1601 + list.sort((a, b) => b[1] - a[1]); 1602 + list.RefreshTime = new Date(); 1603 + }, 1604 + chkD0(zombie, row, triggers, triggersL) { 1605 + // Check triggers moving Right? (Normal Direction) 1606 + const attackLX = zombie.AttackedLX; 1607 + let i = 0; 1608 + const len = triggers.length; 1609 + let t; 1610 + while (i < len) { 1611 + t = triggers[i]; 1612 + if (!t) { 1613 + ++i; 1614 + continue; 1615 + } 1616 + if (t[1] < attackLX) { 1617 + break; 1618 + } 1619 + let plant = $P[t[3]]; 1620 + if (plant && plant.canTrigger && t[0] <= attackLX) { 1621 + plant.TriggerCheck(zombie, t[2], i); 1622 + } 1623 + ++i; 1470 1624 } 1471 - e.sort((i, h) => { 1472 - return h[1] - i[1]; 1473 - }); 1474 - e.RefreshTime = new Date(); 1475 1625 }, 1476 - chkD0(g, e, d, h) { 1477 - var f = g.AttackedLX; 1478 - var c = 0; 1479 - var b; 1480 - var a; 1481 - while (c < d.length && (b = d[c])[1] >= f) { 1482 - (a = $P[b[3]]).canTrigger && b[0] <= f && a.TriggerCheck(g, b[2], c); 1483 - ++c; 1626 + chkD1(zombie, row, triggers, triggersL) { 1627 + // Check triggers moving Left? 1628 + const attackRX = zombie.AttackedRX; 1629 + let i = 0, 1630 + t; 1631 + 1632 + // Sync triggersL if stale 1633 + if (triggers.RefreshTime !== triggersL.RefreshTime) { 1634 + triggersL = (this.$L[row] = triggers.slice(0)).sort((a, b) => a[0] - b[0]); 1635 + triggersL.RefreshTime = triggers.RefreshTime; 1636 + } 1637 + 1638 + while (i < triggersL.length) { 1639 + t = triggersL[i]; 1640 + if (!t) { 1641 + ++i; 1642 + continue; 1643 + } 1644 + if (t[0] > attackRX) { 1645 + break; 1646 + } 1647 + let plant = $P[t[3]]; 1648 + if (plant && plant.canTrigger && t[1] >= attackRX) { 1649 + plant.TriggerCheck(zombie, t[2], i); 1650 + } 1651 + ++i; 1484 1652 } 1485 1653 }, 1486 - chkD1(b, e, c, g) { 1487 - var j = b.AttackedLX; 1488 - var h = b.AttackedRX; 1489 - var f = 0; 1490 - var m; 1491 - var l; 1492 - var d; 1493 - var a; 1494 - var k; 1495 - (l = c.RefreshTime) === g.RefreshTime 1496 - ? (m = g) 1497 - : ((m = (this.$L[e] = c.slice(0)).sort((n, i) => { 1498 - return n[0] - i[0]; 1499 - })).RefreshTime = l); 1500 - while (f < m.length && (d = m[f])[0] <= h) { 1501 - (a = $P[d[3]]).canTrigger && d[1] >= h && a.TriggerCheck(b, d[2], f); 1502 - ++f; 1654 + delP(plant) { 1655 + const triggers = plant.oTrigger; 1656 + const id = plant.id; 1657 + for (let row in triggers) { 1658 + const list = this.$[row]; 1659 + let i = list.length; 1660 + while (i--) { 1661 + if (list[i][3] === id) list.splice(i, 1); 1662 + } 1663 + list.RefreshTime = new Date(); 1503 1664 } 1504 1665 }, 1505 - delP(e) { 1506 - var b = e.oTrigger; 1507 - var f = e.id; 1508 - var d; 1509 - var a; 1510 - var c; 1511 - for (d in b) { 1512 - for (c = (a = this.$[d]).length; c--; a[c][3] === f && a.splice(c, 1)) {} 1513 - a.RefreshTime = new Date(); 1666 + indexOf(arr, val) { 1667 + // Custom regex-based index finder (legacy implementation kept intact) 1668 + const re = new RegExp(val + ",", "g"); 1669 + const str = (arr.toString() + ",").replace(re, "┢,").replace(/[^,┢]/g, ""); 1670 + let idx = 0, 1671 + pos = 0; 1672 + const indices = []; 1673 + while ((pos = str.indexOf("┢", pos)) > 0) { 1674 + indices.push((pos++ - idx++ - 2) / 3); 1514 1675 } 1515 - }, 1516 - indexOf(j, d) { 1517 - var f = new RegExp(d + ",", "g"); 1518 - var h = (j.toString() + ",").replace(f, "┢,").replace(/[^,┢]/g, ""); 1519 - var i = 0; 1520 - var g = 0; 1521 - var b = []; 1522 - for (; (g = h.indexOf("┢", g)) > 0; b.push((g++ - i++ - 2) / 3)) {} 1523 - return b; 1676 + return indices; 1524 1677 }, 1525 1678 }; 1526 - var asyncInnerHTML = function (d, c, a) { 1527 - var b = $n("div"); 1528 - var e = document.createDocumentFragment(); 1529 - b.innerHTML = d; 1530 - (function (g) { 1531 - var f = arguments.callee; 1532 - g-- 1533 - ? (e.appendChild(b.firstChild), 1534 - setTimeout(() => { 1535 - f(g); 1536 - }, 0)) 1537 - : c(e, a); 1538 - })(b.childNodes.length); 1679 + 1680 + var asyncInnerHTML = function (html, callback, args) { 1681 + const div = $n("div"); 1682 + const frag = document.createDocumentFragment(); 1683 + div.innerHTML = html; 1684 + 1685 + (function processNodes(count) { 1686 + if (count--) { 1687 + frag.appendChild(div.firstChild); 1688 + setTimeout(() => processNodes(count), 0); 1689 + } else { 1690 + callback(frag, args); 1691 + } 1692 + })(div.childNodes.length); 1539 1693 }; 1540 - var WhichMouseButton = function (a) { 1541 - a = window.event || a; 1542 - var b = $User.Browser; 1543 - return !b.Gecko ? $SEql(a.button, { 1: 1, 0: b.IE ? 2 : 1, 2: 2, default: 1 }) : $SEql(a.which, { 1: 1, 3: 2, default: 1 }); 1694 + 1695 + var WhichMouseButton = function (e) { 1696 + e = window.event || e; 1697 + const b = $User.Browser; 1698 + // Map buttons to 1 (left), 2 (right), 3 (middle) 1699 + if (!b.Gecko) { 1700 + return $SEql(e.button, { 1: 1, 0: b.IE ? 2 : 1, 2: 2, default: 1 }); 1701 + } else { 1702 + return $SEql(e.which, { 1: 1, 3: 2, default: 1 }); 1703 + } 1544 1704 }; 1545 - var GroundOnmousedown = function (i) { 1546 - i = window.event || i; 1547 - var a = ((i.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft) * 10) / 9; 1548 - var k = ((i.clientY + EBody.scrollTop || EElement.scrollTop) * 10) / 9; 1549 - var g = ChosePlantX(a); 1550 - var h = ChosePlantY(k); 1551 - var d = g[0]; 1552 - var c = h[0]; 1553 - var f = h[1]; 1554 - var b = g[1]; 1555 - var j = GetAP(a, k, f, b); 1705 + 1706 + var GroundOnmousedown = function (e) { 1707 + e = window.event || e; 1708 + const x = ((e.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft) * 10) / 9; 1709 + const y = ((e.clientY + EBody.scrollTop || EElement.scrollTop) * 10) / 9; 1710 + 1711 + const cellX = ChosePlantX(x); 1712 + const cellY = ChosePlantY(y); 1713 + const c = cellX[0]; 1714 + const r = cellY[0]; 1715 + const rType = cellY[1]; 1716 + const cType = cellX[1]; 1717 + 1718 + const ap = GetAP(x, y, rType, cType); 1719 + 1556 1720 switch (oS.Chose) { 1557 - case 1: 1558 - WhichMouseButton(i) < 2 ? GrowPlant(j[0], d, c, f, b) : (PlayAudio("tap"), CancelPlant()); 1721 + case 1: // Planting 1722 + WhichMouseButton(e) < 2 ? GrowPlant(ap[0], c, r, rType, cType) : (PlayAudio("tap"), CancelPlant()); 1559 1723 break; 1560 - case -1: 1561 - WhichMouseButton(i) < 2 ? (PlayAudio("plant2"), ShovelPlant(j)) : (PlayAudio("tap"), CancelShovel()); 1724 + case -1: // Shoveling 1725 + WhichMouseButton(e) < 2 ? (PlayAudio("plant2"), ShovelPlant(ap)) : (PlayAudio("tap"), CancelShovel()); 1562 1726 } 1563 1727 }; 1564 - var GetAP = function (a, h, d, c) { 1565 - var f; 1566 - var i = oGd.$; 1567 - var e; 1568 - var g = []; 1569 - var b; 1570 - for ( 1571 - f = 0; 1572 - f < 4; 1573 - g.push((e = i[d + "_" + c + "_" + f++])), e && !(a < e.pixelLeft || a > e.pixelRight || h < e.pixelTop || h > e.pixelBottom) && (b = e) 1574 - ) {} 1575 - return [g, b]; 1728 + 1729 + var GetAP = function (x, y, r, c) { 1730 + const grid = oGd.$; 1731 + let i = 0, 1732 + plant, 1733 + result = [], 1734 + topPlant; 1735 + 1736 + while (i < 4) { 1737 + plant = grid[r + "_" + c + "_" + i++]; 1738 + if (plant && !(x < plant.pixelLeft || x > plant.pixelRight || y < plant.pixelTop || y > plant.pixelBottom)) { 1739 + topPlant = plant; 1740 + } 1741 + result.push(plant); 1742 + } 1743 + return [result, topPlant]; 1576 1744 }; 1577 - var GroundOnkeydown = function (b) { 1578 - var a = b || window.event; 1579 1745 1580 - if (a.key === "Escape") { 1746 + var GroundOnkeydown = function (e) { 1747 + e = e || window.event; 1748 + 1749 + if (e.key === "Escape") { 1581 1750 switch (oS.Chose) { 1582 1751 case 1: 1583 1752 CancelPlant(); ··· 1590 1759 } 1591 1760 1592 1761 if (!oS.Chose) { 1593 - KeyBoardGrowPlant(a); 1762 + KeyBoardGrowPlant(e); 1594 1763 } 1595 1764 }; 1596 1765 1597 - var KeyBoardGrowPlant = function (e, a) { 1598 - a = a || 0; 1766 + var KeyBoardGrowPlant = function (e, mode) { 1767 + mode = mode || 0; 1599 1768 let plantIndex = -1; 1600 1769 1601 - // Handle top row numbers (Digit0–Digit9) 1602 1770 if (/^Digit[0-9]$/.test(e.code)) { 1603 1771 plantIndex = parseInt(e.code.replace("Digit", "")); 1604 - } 1605 - 1606 - // Handle numpad numbers (Numpad0–Numpad9) 1607 - else if (/^Numpad[0-9]$/.test(e.code)) { 1772 + } else if (/^Numpad[0-9]$/.test(e.code)) { 1608 1773 plantIndex = parseInt(e.code.replace("Numpad", "")); 1609 1774 } 1610 1775 1611 - if (plantIndex !== -1 && a === 0) { 1612 - // Adjust so 0 = slot 9 (10th slot), 1–9 = slot 0–8 1776 + if (plantIndex !== -1 && mode === 0) { 1613 1777 plantIndex = plantIndex === 0 ? 9 : plantIndex - 1; 1614 1778 ChosePlant({ clientX: 450, clientY: 300 }, plantIndex.toString()); 1615 1779 } 1616 1780 }; 1617 1781 1618 1782 var GroundOnmousemove = function () {}; 1619 - var GroundOnmousemove1 = function (j) { 1620 - j = window.event || j; 1621 - var d = ((j.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft) * 10) / 9; 1622 - var b = ((j.clientY + EBody.scrollTop || EElement.scrollTop) * 10) / 9; 1623 - var k = oS.ChoseCard; 1624 - var h = ChosePlantX(d); 1625 - var i = ChosePlantY(b); 1626 - var f = h[0]; 1627 - var c = i[0]; 1628 - var g = i[1]; 1629 - var a = h[1]; 1630 - var m = GetAP(d, b, g, a); 1631 - var l = ArCard[k].PName.prototype; 1783 + 1784 + var GroundOnmousemove1 = function (e) { 1785 + e = window.event || e; 1786 + const x = ((e.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft) * 10) / 9; 1787 + const y = ((e.clientY + EBody.scrollTop || EElement.scrollTop) * 10) / 9; 1788 + 1789 + const cardIdx = oS.ChoseCard; 1790 + const cellX = ChosePlantX(x); 1791 + const cellY = ChosePlantY(y); 1792 + const c = cellX[0]; 1793 + const r = cellY[0]; 1794 + const rType = cellY[1]; 1795 + const cType = cellX[1]; 1796 + 1797 + const ap = GetAP(x, y, rType, cType); 1798 + const proto = ArCard[cardIdx].PName.prototype; 1799 + 1632 1800 SetStyle($("MovePlant"), { 1633 - left: d - 0.5 * (l.beAttackedPointL + l.beAttackedPointR) + "px", 1634 - top: b + 20 - l.height + "px", 1801 + left: x - 0.5 * (proto.beAttackedPointL + proto.beAttackedPointR) + "px", 1802 + top: y + 20 - proto.height + "px", 1635 1803 }); 1636 - l.CanGrow(m[0], g, a) 1637 - ? SetStyle($("MovePlantAlpha"), { 1638 - visibility: "visible", 1639 - left: f + l.GetDX() + "px", 1640 - top: c - l.height + l.GetDY(g, a, m[0]) + "px", 1641 - }) 1642 - : SetHidden($("MovePlantAlpha")); 1804 + 1805 + if (proto.CanGrow(ap[0], rType, cType)) { 1806 + SetStyle($("MovePlantAlpha"), { 1807 + visibility: "visible", 1808 + left: c + proto.GetDX() + "px", 1809 + top: r - proto.height + proto.GetDY(rType, cType, ap[0]) + "px", 1810 + }); 1811 + } else { 1812 + SetHidden($("MovePlantAlpha")); 1813 + } 1643 1814 }; 1644 - var GroundOnmousemove2 = function (k) { 1645 - k = window.event || k; 1646 - var d = k.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft; 1647 - var b = k.clientY + EBody.scrollTop || EElement.scrollTop; 1648 - var m = oS.ChoseCard; 1649 - var h = ChosePlantX(d); 1650 - var i = ChosePlantY(b); 1651 - var f = h[0]; 1652 - var c = i[0]; 1653 - var g = i[1]; 1654 - var a = h[1]; 1655 - var n = GetAP(d, b, g, a); 1656 - var j = n[1]; 1657 - var l = j ? j.id : ""; 1658 - var p = oS.MPID; 1659 - p !== l && (p && SetAlpha($(p).childNodes[1], 100, 1), (oS.MPID = l) && SetAlpha($(l).childNodes[1], 60, 0.6)); 1815 + 1816 + var GroundOnmousemove2 = function (e) { 1817 + e = window.event || e; 1818 + const x = e.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft; 1819 + const y = e.clientY + EBody.scrollTop || EElement.scrollTop; 1820 + 1821 + const cellX = ChosePlantX(x); 1822 + const cellY = ChosePlantY(y); 1823 + const rType = cellY[1]; 1824 + const cType = cellX[1]; 1825 + 1826 + const ap = GetAP(x, y, rType, cType); 1827 + const plant = ap[1]; 1828 + const plantId = plant ? plant.id : ""; 1829 + const prevId = oS.MPID; 1830 + 1831 + if (prevId !== plantId) { 1832 + if (prevId) SetAlpha($(prevId).childNodes[1], 100, 1); 1833 + if ((oS.MPID = plantId)) SetAlpha($(plantId).childNodes[1], 60, 0.6); 1834 + } 1835 + 1660 1836 SetStyle($("tShovel"), { 1661 - left: ((d - 15) * 10) / 9 + "px", 1662 - top: ((b - 16) * 10) / 9 + "px", 1837 + left: ((x - 15) * 10) / 9 + "px", 1838 + top: ((y - 16) * 10) / 9 + "px", 1663 1839 }); 1664 1840 }; 1841 + 1665 1842 var DisplayZombie = function () { 1666 1843 SetVisible($("bShowHandBook")); 1667 - /* SetVisible($("bMainMenu")); */ 1668 - var d = oP.AZ.slice(0); 1669 - var b = d.length; 1670 - var c; 1671 - var g; 1672 - var h = $("dZombie"); 1673 - var f = []; 1674 - var e = []; 1675 - var a; 1676 - while (b--) { 1677 - d[b][0].prototype.CanDiaplay === 0 && d.splice(b, 1); 1844 + 1845 + const azCopy = oP.AZ.slice(0); 1846 + let i = azCopy.length; 1847 + const zombieDiv = $("dZombie"); 1848 + const positions = []; 1849 + const htmlList = []; 1850 + 1851 + while (i--) { 1852 + if (azCopy[i][0].prototype.CanDiaplay === 0) azCopy.splice(i, 1); 1678 1853 } 1679 - c = b = d.length; 1680 - while (c--) { 1681 - f.push(Math.floor(150 + Math.random() * 444)); 1854 + 1855 + let count = (i = azCopy.length); 1856 + while (count--) { 1857 + positions.push(Math.floor(150 + Math.random() * 444)); 1682 1858 } 1683 - f.sort((j, i) => { 1684 - return j - i; 1685 - }); 1686 - while (b) { 1687 - g = d[(a = Math.floor(Math.random() * b))][0].prototype; 1688 - g.CanDisplay 1689 - ? (d.splice(a, 1), 1690 - (e[b--] = g.getHTML( 1691 - "", 1692 - Math.floor(50 + Math.random() * 201) - g.width * 0.5, 1693 - f[b] - g.height, 1694 - 1, 1695 - "block", 1696 - "auto", 1697 - g.GetDTop, 1698 - g.PicArr[g.StandGif] 1699 - ))) 1700 - : --b; 1859 + positions.sort((a, b) => a - b); 1860 + 1861 + while (i) { 1862 + let randIdx = Math.floor(Math.random() * i); 1863 + let proto = azCopy[randIdx][0].prototype; 1864 + 1865 + if (proto.CanDisplay) { 1866 + azCopy.splice(randIdx, 1); 1867 + htmlList[i--] = proto.getHTML( 1868 + "", 1869 + Math.floor(50 + Math.random() * 201) - proto.width * 0.5, 1870 + positions[i] - proto.height, 1871 + 1, 1872 + "block", 1873 + "auto", 1874 + proto.GetDTop, 1875 + proto.PicArr[proto.StandGif] 1876 + ); 1877 + } else { 1878 + --i; 1879 + } 1701 1880 } 1702 - asyncInnerHTML(e.join(""), (i) => { 1703 - h.appendChild(i); 1881 + 1882 + asyncInnerHTML(htmlList.join(""), (frag) => { 1883 + zombieDiv.appendChild(frag); 1704 1884 }); 1705 1885 }; 1886 + 1706 1887 var AutoSelectCard = function () { 1707 - var c = oS.ArCard; 1708 - var b = -1; 1709 - var a = c.length; 1710 - while (++b < a) { 1711 - SelectCard(c[b].prototype.EName); 1888 + const cards = oS.ArCard; 1889 + let i = -1; 1890 + const len = cards.length; 1891 + while (++i < len) { 1892 + SelectCard(cards[i].prototype.EName); 1712 1893 } 1713 1894 }; 1895 + 1714 1896 var InitPCard = function () { 1715 - var d = ""; 1716 - var f; 1717 - var e = oS.ArCard; 1718 - var a = e.length; 1719 - var b = 0; 1720 - var c; 1721 - while (b < a) { 1722 - f = e[b]; 1723 - c = f.prototype; 1724 - if (!c.CanSelect) { 1725 - ++b; 1897 + let html = ""; 1898 + const cards = oS.ArCard; 1899 + const len = cards.length; 1900 + let i = 0; 1901 + 1902 + while (i < len) { 1903 + let card = cards[i]; 1904 + let proto = card.prototype; 1905 + if (!proto.CanSelect) { 1906 + ++i; 1726 1907 continue; 1727 1908 } 1728 - ArPCard[(EName = c.EName)] = { Select: 0, PName: f }; 1729 - d += 1730 - '<div class="span1" id="Card' + 1731 - EName + 1732 - '" onmouseout="SetHidden($(\'dTitle\'))" onmousemove="ViewCardTitle(' + 1733 - EName + 1734 - ',event)" onclick="SelectCard(\'' + 1735 - EName + 1736 - '\')"><img src="' + 1737 - c.PicArr[0] + 1738 - '"><span class="span2">' + 1739 - c.SunNum + 1740 - "</span></div>"; 1741 - b++ % 6 === 5 && (d += "<br>"); 1909 + let name = proto.EName; 1910 + ArPCard[name] = { Select: 0, PName: card }; 1911 + html += `<div class="span1" id="Card${name}" onmouseout="SetHidden($('dTitle'))" onmousemove="ViewCardTitle(${name},event)" onclick="SelectCard('${name}')"><img src="${proto.PicArr[0]}"><span class="span2">${proto.SunNum}</span></div>`; 1912 + if (i++ % 6 === 5) html += "<br>"; 1742 1913 } 1743 - $("dPCard").innerHTML = d; 1914 + $("dPCard").innerHTML = html; 1744 1915 }; 1916 + 1745 1917 var InitHandBookPCard = function () { 1746 1918 PlayAudio("gravebutton"); 1747 - var d = ""; 1748 - var g; 1749 - var f; 1750 - var e = [ 1751 - oPeashooter, 1752 - oSunFlower, 1753 - oCherryBomb, 1754 - oWallNut, 1755 - oPotatoMine, 1756 - oSnowPea, 1757 - oChomper, 1758 - oRepeater, 1759 - oPuffShroom, 1760 - oSunShroom, 1761 - oFumeShroom, 1762 - oGraveBuster, 1763 - oHypnoShroom, 1764 - oScaredyShroom, 1765 - oIceShroom, 1766 - oDoomShroom, 1767 - oLilyPad, 1768 - oSquash, 1769 - oThreepeater, 1770 - oTangleKlep, 1771 - oJalapeno, 1772 - oSpikeweed, 1773 - oTorchwood, 1774 - oTallNut, 1775 - oCactus, 1776 - oPlantern, 1777 - oSplitPea, 1778 - oStarfruit, 1779 - oPumpkinHead, 1780 - oFlowerPot, 1781 - oCoffeeBean, 1782 - oGarlic, 1783 - oSeaShroom, 1784 - oOxygen, 1785 - ostar, 1786 - oTTS, 1787 - oGun, 1788 - oSeaAnemone, 1789 - oGatlingPea, 1790 - oGloomShroom, 1791 - oTwinSunflower, 1792 - oSpikerock, 1793 - oTenManNut, 1794 - oSnowRepeater, 1795 - oCattail, 1796 - oLotusRoot, 1797 - oIceFumeShroom, 1798 - oLaserBean, 1799 - oBigChomper, 1800 - oFlamesMushroom, 1801 - oBalloon, 1802 - ]; 1803 - var a = e.length; 1804 - var b = 0; 1805 - var c; 1806 - while (b < a) { 1807 - g = e[b]; 1808 - c = g.prototype; 1809 - f = c.EName; 1810 - d += '<div class="span1" onclick="ViewProducePlant(' + f + ')"><img src="' + c.PicArr[0] + '"><div class="span2">' + c.SunNum + "</div></div>"; 1811 - b++ % 6 === 5 && (d += "<br>"); 1919 + let html = ""; 1920 + let i = 0; 1921 + const len = allPlantsArray().length; 1922 + 1923 + while (i < len) { 1924 + let proto = allPlantsArray()[i].prototype; 1925 + let name = proto.EName; 1926 + html += `<div class="span1" onclick="ViewProducePlant(${name})"><img src="${proto.PicArr[0]}"><div class="span2">${proto.SunNum}</div></div>`; 1927 + if (i++ % 6 === 5) html += "<br>"; 1812 1928 } 1813 - $("dHandBookPCard").innerHTML = d; 1814 - ViewProducePlant(e[0]); 1929 + 1930 + $("dHandBookPCard").innerHTML = html; 1931 + ViewProducePlant(allPlantsArray()[0]); 1815 1932 $("dHandBookPZ").className = "WindowFrame Almanac_PlantBack"; 1816 1933 SetVisible($("dHandBookPZ")); 1817 1934 SetNone($("dHandBookZ")); 1818 1935 SetBlock($("dHandBookP")); 1819 1936 }; 1937 + 1820 1938 var InitHandBookZCard = function () { 1821 1939 PlayAudio("gravebutton"); 1822 - var d = ""; 1823 - var g; 1824 - var f; 1825 - var e = [ 1940 + let html = ""; 1941 + const zombies = [ 1826 1942 oZombie, 1827 1943 oConeheadZombie, 1828 1944 oPoleVaultingZombie, ··· 1860 1976 oTrashZombie, 1861 1977 oLionDanceZombie, 1862 1978 ]; 1863 - var a = e.length; 1864 - var b = 0; 1865 - var c; 1866 - while (b < a) { 1867 - g = e[b]; 1868 - c = g.prototype; 1869 - f = c.EName; 1870 - d += '<div class="span1" onclick="ViewProduceZombie(' + f + ')"><img src="' + c.PicArr[0] + '"><div class="span2">' + c.SunNum + "</div></div>"; 1871 - b++; 1979 + let i = 0; 1980 + const len = zombies.length; 1981 + 1982 + while (i < len) { 1983 + let proto = zombies[i].prototype; 1984 + let name = proto.EName; 1985 + html += `<div class="span1" onclick="ViewProduceZombie(${name})"><img src="${proto.PicArr[0]}"><div class="span2">${proto.SunNum}</div></div>`; 1986 + i++; 1872 1987 } 1873 - $("dHandBookZCard").innerHTML = d; 1874 - ViewProduceZombie(e[0]); 1988 + 1989 + $("dHandBookZCard").innerHTML = html; 1990 + ViewProduceZombie(zombies[0]); 1875 1991 $("dHandBookPZ").className = "WindowFrame Almanac_ZombieBack"; 1876 1992 SetVisible($("dHandBookPZ")); 1877 1993 SetNone($("dHandBookP")); 1878 1994 SetBlock($("dHandBookZ")); 1879 1995 }; 1996 + 1880 1997 var lastB; 1881 - (ViewProducePlant = function (b) { 1882 - if (lastB !== b) { 1883 - lastB = b; 1884 - var a = b.prototype; 1998 + var ViewProducePlant = function (plantClass) { 1999 + if (lastB !== plantClass) { 2000 + lastB = plantClass; 2001 + const proto = plantClass.prototype; 1885 2002 PlayAudio("tap"); 1886 - $("pHandBookPlant").style.backgroundImage = "url(" + a.PicArr[a.AlmanacGif] + ")"; 1887 - $("pHandBookPlant").style.backgroundPosition = a.BookHandPosition || "50% " + (45 + a.height / 4) + "%"; 1888 - $("dProducePlant").innerHTML = a.Produce; 1889 - innerText($("dHandBookPlantName"), a.CName); 1890 - innerText($("spSunNum"), a.SunNum); 1891 - innerText($("spCoolTime"), a.coolTime + "s"); 1892 - $("pPlantBack").style.background = "url('images/interface/Almanac_Ground" + a.BookHandBack + ".jpg')"; 1893 - // $("pPlantBack").style.backgroundPosition = -200 * a.BookHandBack + "px 0"; 2003 + $("pHandBookPlant").style.backgroundImage = "url(" + proto.PicArr[proto.StaticGif] + ")"; 2004 + $("pHandBookPlant").style.backgroundPosition = "50% " + (60 + proto.height / 4) + "%"; 2005 + $("dProducePlant").innerHTML = proto.Produce; 2006 + innerText($("dHandBookPlantName"), proto.CName); 2007 + innerText($("spSunNum"), proto.SunNum); 2008 + innerText($("spCoolTime"), proto.coolTime + "s"); 2009 + $("pPlantBack").style.backgroundPosition = -200 * proto.BookHandBack + "px 0"; 2010 + } 2011 + }; 2012 + 2013 + var ViewProduceZombie = function (zombieClass) { 2014 + PlayAudio("tap"); 2015 + const proto = zombieClass.prototype; 2016 + $("pHandBookZombie").style.background = "url(" + proto.PicArr[proto.StaticGif] + ") no-repeat scroll " + proto.BookHandPosition; 2017 + $("dProduceZombie").innerHTML = proto.Produce; 2018 + innerText($("dHandBookZombieName"), proto.CName); 2019 + $("pZombieBack").style.backgroundPosition = -200 * proto.BookHandBack + "px 0"; 2020 + }; 2021 + 2022 + var ViewCardTitle = function (plantClass, e) { 2023 + e = e || window.event; 2024 + const titleDiv = $("dTitle"); 2025 + const proto = plantClass.prototype; 2026 + let html = proto.CName + "<br>cooldown: " + proto.coolTime + "s<br>"; 2027 + 2028 + if (oS.DKind && proto.night) { 2029 + html += '<span style="color:#F00">Nocturnal - sleeps during the day</span><br>' + proto.Tooltip; 2030 + } else { 2031 + html += proto.Tooltip || '<span style="text-align:left">' + proto.Produce + "</span>"; 1894 2032 } 1895 - }), 1896 - (ViewProduceZombie = function (b) { 1897 - PlayAudio("tap"); 1898 - var a = b.prototype; 1899 - $("pHandBookZombie").style.background = "url(" + a.PicArr[a.AlmanacGif] + ") no-repeat scroll " + a.BookHandPosition; 1900 - $("dProduceZombie").innerHTML = a.Produce; 1901 - innerText($("dHandBookZombieName"), a.CName); 1902 - $("pZombieBack").style.background = "url('images/interface/Almanac_Ground" + a.BookHandBack + ".jpg')"; 1903 - }), 1904 - (ViewCardTitle = function (b, c) { 1905 - c = c || window.event; 1906 - var f = $("dTitle"); 1907 - var a = b.prototype; 1908 - f.innerHTML = 1909 - a.CName + 1910 - "<br>cooldown: " + 1911 - a.coolTime + 1912 - "s<br>" + 1913 - (oS.DKind && a.night 1914 - ? '<span style="color:#F00">Nocturnal - sleeps during the day</span><br>' + a.Tooltip 1915 - : a.Tooltip || '<span style="text-align:left">' + a.Produce + "</span>"); 1916 - SetStyle(f, { 1917 - left: c.clientX + (EBody.scrollLeft || EElement.scrollLeft) - 3 + "px", 1918 - top: c.clientY + 18 + EBody.scrollTop || EElement.scrollTop + "px", 1919 - visibility: "visible", 1920 - }); 1921 - }), 1922 - (ViewGenericMouseover = function (b, c) { 1923 - // b is innerhtml, c is event 1924 - c = c || window.event; 1925 - var a = $("dTitle"); 1926 - a.innerHTML = b; 1927 - SetStyle(a, { 1928 - left: c.clientX + (EBody.scrollLeft || EElement.scrollLeft) - 3 + "px", 1929 - top: c.clientY + 18 + (EBody.scrollTop || EElement.scrollTop) + "px", 1930 - visibility: "visible", 1931 - }); 1932 - }), 1933 - (SelectCard = function (c) { 1934 - PlayAudio("tap"); 1935 - var h = $("Card" + c).childNodes; 1936 - var f = h[0]; 1937 - var b = ArPCard[c]; 1938 - var i = b.PName.prototype; 1939 - var g; 1940 - var a; 1941 - var j; 1942 - var e = $("btnOK"); 1943 - if (!b.Select) { 1944 - if (!(ArPCard.SelNum |= 0)) { 1945 - e.disabled = ""; 1946 - e.style.color = "#FC6"; 1947 - } else if (ArPCard.SelNum > 9) { 2033 + 2034 + titleDiv.innerHTML = html; 2035 + SetStyle(titleDiv, { 2036 + left: e.clientX + (EBody.scrollLeft || EElement.scrollLeft) - 3 + "px", 2037 + top: e.clientY + 18 + EBody.scrollTop || EElement.scrollTop + "px", 2038 + visibility: "visible", 2039 + }); 2040 + }; 2041 + 2042 + var ViewGenericMouseover = function (content, e) { 2043 + e = e || window.event; 2044 + const titleDiv = $("dTitle"); 2045 + titleDiv.innerHTML = content; 2046 + SetStyle(titleDiv, { 2047 + left: e.clientX + (EBody.scrollLeft || EElement.scrollLeft) - 3 + "px", 2048 + top: e.clientY + 18 + (EBody.scrollTop || EElement.scrollTop) + "px", 2049 + visibility: "visible", 2050 + }); 2051 + }; 2052 + 2053 + var SelectCard = function (name, retry) { 2054 + PlayAudio("tap"); 2055 + retry |= 0; 2056 + 2057 + const cardDom = $("Card" + name); 2058 + const btnOK = $("btnOK"); 2059 + const cardObj = ArPCard && ArPCard[name]; 2060 + 2061 + if (!cardDom || !btnOK || !cardObj || !cardObj.PName) { 2062 + if (retry < 50 && typeof oSym !== "undefined" && oSym && typeof oSym.addTask === "function") { 2063 + oSym.addTask(1, SelectCard, [name, retry + 1]); 2064 + } 2065 + return; 2066 + } 2067 + 2068 + const cardEle = cardDom.childNodes; 2069 + const imgEle = cardEle && cardEle[0]; 2070 + const proto = cardObj.PName.prototype; 2071 + if (!imgEle) { 2072 + return; 2073 + } 2074 + 2075 + if (!cardObj.Select) { 2076 + if (!(ArPCard.SelNum |= 0)) { 2077 + btnOK.disabled = ""; 2078 + btnOK.style.color = "#FC6"; 2079 + } else if (ArPCard.SelNum > 9) { 2080 + return; 2081 + } 2082 + ++ArPCard.SelNum; 2083 + cardObj.Select = 1; 2084 + 2085 + if (oS.StaticCard) { 2086 + const cardList = $("dCardList"); 2087 + if (!cardList) { 1948 2088 return; 1949 2089 } 1950 - ++ArPCard.SelNum; 1951 - b.Select = 1; 1952 - oS.StaticCard && 1953 - ((g = NewEle( 1954 - "dCard" + c, 1955 - "div", 1956 - "", 1957 - { 1958 - onclick() { 1959 - SelectCard(c); 1960 - }, 2090 + const newCard = NewEle( 2091 + "dCard" + name, 2092 + "div", 2093 + "", 2094 + { 2095 + onclick() { 2096 + SelectCard(name); 1961 2097 }, 1962 - $("dCardList") 1963 - )), 1964 - NewImg(0, f.src, "width:100px;height:120px", g), 1965 - innerText(NewEle("sSunNum" + c, "span", 0, 0, g), i.SunNum), 1966 - (f.style.filter = "grayscale(1) brightness(1.15)")); 1967 - } else { 1968 - b.Select = 0; 1969 - !--ArPCard.SelNum && ((e.disabled = "disabled"), (e.style.color = "#888")); 1970 - (g = $("dCard" + c)).onclick = null; 1971 - ClearChild(g.firstChild, g.childNodes[1], g.lastChild, g); 1972 - f.style.filter = "grayscale(0) brightness(1)"; 2098 + }, 2099 + cardList 2100 + ); 2101 + NewImg(0, imgEle.src, "width:100px;height:120px", newCard); 2102 + innerText(NewEle("sSunNum" + name, "span", 0, 0, newCard), proto.SunNum); 2103 + imgEle.style.filter = "grayscale(1) brightness(1.15)"; 1973 2104 } 1974 - }), 1975 - (ResetSelectCard = function () { 1976 - var b; 1977 - var a = $("btnOK"); 1978 - for (b in ArPCard) { 1979 - ArPCard[b].Select && SelectCard(b); 2105 + } else { 2106 + cardObj.Select = 0; 2107 + if (!--ArPCard.SelNum) { 2108 + btnOK.disabled = "disabled"; 2109 + btnOK.style.color = "#888"; 1980 2110 } 1981 - a.disabled = "disalbed"; 1982 - a.style.color = "#888"; 1983 - }), 1984 - (LetsGO = function () { 1985 - var e = $("dCardList"); 1986 - var g = 0; 1987 - var k = e.childNodes.length; 1988 - var f; 1989 - var h; 1990 - var l; 1991 - var c; 1992 - var j; 1993 - var a; 1994 - var b = document.body; 1995 - SetStyle($("dTop"), { left: "105px", top: 0 }); 1996 - e.style.left = 0; 1997 - SetVisible(e); 1998 - while (g < k) { 1999 - (function (d) { 2000 - f = (j = e.childNodes[d]).id.substr(5); 2001 - l = (h = ArPCard[f].PName).prototype; 2002 - j.onclick = function (i) { 2003 - ChosePlant(i, d); 2004 - }; 2005 - j.onmouseover = function () { 2006 - SetVisible($("dTitle")); 2007 - ViewPlantTitle((oS.MCID = d)); 2008 - }; 2009 - j.onmouseout = function () { 2010 - SetHidden($("dTitle")); 2011 - }; 2012 - j.firstChild.style.filter = "grayscale(1) brightness(1.15)"; 2013 - (a = j.lastChild).id = "sSunNum" + d; 2014 - innerText(a, l.SunNum); 2015 - ArCard.push({ DID: j.id, CDReady: 0, SunReady: 0, PName: h }); 2016 - })(g++); 2111 + const newCard = $("dCard" + name); 2112 + if (newCard) { 2113 + newCard.onclick = null; 2114 + ClearChild(newCard.firstChild, newCard.childNodes[1], newCard.lastChild, newCard); 2017 2115 } 2018 - b.onkeydown = function (d) { 2019 - GroundOnkeydown(d); 2020 - }; 2021 - b.onmousedown = function (d) { 2022 - GroundOnmousedown(d); 2023 - }; 2024 - b.onmousemove = function (d) { 2025 - GroundOnmousemove(d); 2026 - }; 2027 - SetVisible(e); 2028 - !oS.BrainsNum && CustomSpecial(oBrains, oS.R - 1, -2); 2029 - ( 2030 - oS.StartGame || 2031 - function () { 2032 - StopMusic(); 2033 - PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 2034 - NewMusic((oS.LoadMusic = oS.StartGameMusic)); 2035 - SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 2036 - oS.InitLawnMower(); 2037 - PrepareGrowPlants(() => { 2038 - oP.Monitor(oS.Monitor, oS.UserDefinedFlagFunc); 2039 - BeginCool(); 2040 - oS.DKind && AutoProduceSun(25); 2041 - oSym.addTask( 2042 - 1500, 2043 - () => { 2044 - oP.AddZombiesFlag(); 2045 - SetVisible($("dFlagMeterContent")); 2046 - }, 2047 - [] 2048 - ); 2049 - }); 2050 - } 2051 - )(); 2052 - oS.StartTime = oSym.Now; 2053 - }), 2054 - (ViewPlantTitle = function (b) { 2055 - var f = $("dTitle"); 2056 - var e = ArCard[b]; 2057 - var c = e.PName.prototype; 2058 - var a = c.CName; 2059 - !oS.CardKind && ((a += "<br>cooldown: " + c.coolTime + "s<br>" + c.Tooltip), !e.CDReady && (a += '<br><span style="color:#F00">recharging</span>')); 2060 - !e.SunReady && (a += '<br><span style="color:#F00">not enough sun</span>'); 2061 - f.innerHTML = a; 2062 - SetStyle(f, { top: 60 * b + "px", left: EDAlloffsetLeft + 100 + "px" }); 2063 - }), 2064 - (BeginCool = function () { 2065 - var b = ArCard.length; 2066 - var c; 2067 - var d; 2068 - var a; 2069 - var e; 2070 - while (b--) { 2071 - a = (c = (d = ArCard[b]).PName.prototype).coolTime; 2072 - e = c.SunNum; 2073 - switch (a) { 2074 - case 0: 2075 - case 7.5: 2076 - d.CDReady = 1; 2077 - e <= oS.SunNum && ((d.SunReady = 1), ($(d.DID).childNodes[0].style.filter = "grayscale(0) brightness(1)")); 2078 - break; 2079 - case 30: 2080 - DoCoolTimer(b, 20); 2081 - break; 2082 - default: 2083 - DoCoolTimer(b, 35); 2084 - } 2116 + imgEle.style.filter = "grayscale(0) brightness(1)"; 2117 + } 2118 + }; 2119 + 2120 + var ResetSelectCard = function () { 2121 + const btnOK = $("btnOK"); 2122 + for (let name in ArPCard) { 2123 + if (ArPCard[name].Select) SelectCard(name); 2124 + } 2125 + btnOK.disabled = "disalbed"; 2126 + btnOK.style.color = "#888"; 2127 + }; 2128 + 2129 + var LetsGO = function () { 2130 + const cardListDiv = $("dCardList"); 2131 + let i = 0; 2132 + const len = cardListDiv.childNodes.length; 2133 + const body = document.body; 2134 + 2135 + SetStyle($("dTop"), { left: "105px", top: 0 }); 2136 + cardListDiv.style.left = 0; 2137 + SetVisible(cardListDiv); 2138 + 2139 + while (i < len) { 2140 + (function (idx) { 2141 + const ele = cardListDiv.childNodes[idx]; 2142 + const name = ele.id.substr(5); 2143 + const cardData = ArPCard[name].PName; 2144 + const proto = cardData.prototype; 2145 + 2146 + ele.onclick = function (e) { 2147 + ChosePlant(e, idx); 2148 + }; 2149 + ele.onmouseover = function () { 2150 + SetVisible($("dTitle")); 2151 + ViewPlantTitle((oS.MCID = idx)); 2152 + }; 2153 + ele.onmouseout = function () { 2154 + SetHidden($("dTitle")); 2155 + }; 2156 + 2157 + ele.firstChild.style.filter = "grayscale(1) brightness(1.15)"; 2158 + ele.lastChild.id = "sSunNum" + idx; 2159 + innerText(ele.lastChild, proto.SunNum); 2160 + ArCard.push({ DID: ele.id, CDReady: 0, SunReady: 0, PName: cardData }); 2161 + })(i++); 2162 + } 2163 + 2164 + body.onkeydown = function (e) { 2165 + GroundOnkeydown(e); 2166 + }; 2167 + body.onmousedown = function (e) { 2168 + GroundOnmousedown(e); 2169 + }; 2170 + body.onmousemove = function (e) { 2171 + GroundOnmousemove(e); 2172 + }; 2173 + 2174 + SetVisible(cardListDiv); 2175 + if (!oS.BrainsNum) CustomSpecial(oBrains, oS.R - 1, -2); 2176 + 2177 + ( 2178 + oS.StartGame || 2179 + function () { 2180 + StopMusic(); 2181 + PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 2182 + NewMusic((oS.LoadMusic = oS.StartGameMusic)); 2183 + SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 2184 + oS.InitLawnMower(); 2185 + 2186 + PrepareGrowPlants(() => { 2187 + oP.Monitor(oS.Monitor, oS.UserDefinedFlagFunc); 2188 + BeginCool(); 2189 + if (oS.DKind) AutoProduceSun(25); 2190 + oSym.addTask( 2191 + 1500, 2192 + () => { 2193 + oP.AddZombiesFlag(); 2194 + SetVisible($("dFlagMeterContent")); 2195 + }, 2196 + [] 2197 + ); 2198 + }); 2085 2199 } 2086 - }), 2087 - (ImmediatelyCool = function () { 2088 - var b = ArCard.length; 2089 - var c; 2090 - var d; 2091 - var a; 2092 - var e; 2093 - while (b--) { 2094 - a = (c = (d = ArCard[b]).PName.prototype).coolTime; 2095 - e = c.SunNum; 2096 - d.CDReady = 1; 2097 - d.SunReady = 1; 2098 - $(d.DID).childNodes[0].style.filter = "grayscale(0) brightness(1)"; 2200 + )(); 2201 + 2202 + oS.StartTime = oSym.Now; 2203 + }; 2204 + 2205 + var ViewPlantTitle = function (index) { 2206 + const titleDiv = $("dTitle"); 2207 + const card = ArCard[index]; 2208 + const proto = card.PName.prototype; 2209 + let html = proto.CName; 2210 + 2211 + if (!oS.CardKind) { 2212 + html += "<br>cooldown: " + proto.coolTime + "s<br>" + proto.Tooltip; 2213 + if (!card.CDReady) html += '<br><span style="color:#F00">recharging</span>'; 2214 + } 2215 + if (!card.SunReady) { 2216 + html += '<br><span style="color:#F00">not enough sun</span>'; 2217 + } 2218 + 2219 + titleDiv.innerHTML = html; 2220 + SetStyle(titleDiv, { top: 60 * index + "px", left: EDAlloffsetLeft + 100 + "px" }); 2221 + }; 2222 + 2223 + var BeginCool = function () { 2224 + let i = ArCard.length; 2225 + while (i--) { 2226 + const card = ArCard[i]; 2227 + const proto = card.PName.prototype; 2228 + const coolTime = proto.coolTime; 2229 + const sunCost = proto.SunNum; 2230 + 2231 + switch (coolTime) { 2232 + case 0: 2233 + case 7.5: 2234 + card.CDReady = 1; 2235 + if (sunCost <= oS.SunNum) { 2236 + card.SunReady = 1; 2237 + $(card.DID).childNodes[0].style.filter = "grayscale(0) brightness(1)"; 2238 + } 2239 + break; 2240 + case 30: 2241 + DoCoolTimer(i, 20); 2242 + break; 2243 + default: 2244 + DoCoolTimer(i, 35); 2099 2245 } 2100 - }), 2101 - (MonitorCard = function (d) { 2102 - var b = ArCard.length; 2103 - var c; 2104 - var a = Number(ESSunNum.innerHTML); 2105 - a !== oS.SunNum && (oS.SunNum = Math.min(a, oS.SunNum)); 2106 - if (oS.Chose < 1) { 2107 - while (b--) { 2108 - (c = (d = ArCard[b]).PName.prototype).SunNum > oS.SunNum 2109 - ? (d.SunReady && (d.SunReady = 0), ($(d.DID).childNodes[0].style.filter = "grayscale(1) brightness(1.15)")) 2110 - : (!d.SunReady && (d.SunReady = 1), d.CDReady && ($(d.DID).childNodes[0].style.filter = "grayscale(0) brightness(1)")); 2111 - } 2112 - } else { 2113 - while (b--) { 2114 - (c = (d = ArCard[b]).PName.prototype).SunNum > oS.SunNum ? d.SunReady && (d.SunReady = 0) : !d.SunReady && (d.SunReady = 1); 2246 + } 2247 + }; 2248 + 2249 + var ImmediatelyCool = function () { 2250 + let i = ArCard.length; 2251 + while (i--) { 2252 + const card = ArCard[i]; 2253 + card.CDReady = 1; 2254 + card.SunReady = 1; 2255 + $(card.DID).childNodes[0].style.filter = "grayscale(0) brightness(1)"; 2256 + } 2257 + }; 2258 + 2259 + var MonitorCard = function (card) { 2260 + let i = ArCard.length; 2261 + const currentSunHTML = Number(ESSunNum.innerHTML); 2262 + 2263 + if (currentSunHTML !== oS.SunNum) { 2264 + oS.SunNum = Math.min(currentSunHTML, oS.SunNum); 2265 + } 2266 + 2267 + if (oS.Chose < 1) { 2268 + while (i--) { 2269 + card = ArCard[i]; 2270 + let proto = card.PName.prototype; 2271 + 2272 + if (proto.SunNum > oS.SunNum) { 2273 + if (card.SunReady) card.SunReady = 0; 2274 + $(card.DID).childNodes[0].style.filter = "grayscale(1) brightness(1.15)"; 2275 + } else { 2276 + if (!card.SunReady) card.SunReady = 1; 2277 + if (card.CDReady) $(card.DID).childNodes[0].style.filter = "grayscale(0) brightness(1)"; 2115 2278 } 2116 2279 } 2117 - ViewPlantTitle(oS.MCID); 2118 - }), 2119 - (DoCoolTimer = function (c, b) { 2120 - var a = $(ArCard[c].DID); 2121 - NewEle("dCD1" + c, "span", "position:absolute;left:22px;top:22px;font-size:18px;font-weight:500;font-family:Verdana;color:#000", "", a); 2122 - NewEle("dCD2" + c, "span", "position:absolute;left:20px;top:20px;font-size:18px;font-weight:500;font-family:Verdana;color:#FF0", "", a); 2123 - (function (d, e) { 2124 - d > 0 2125 - ? (innerText($("dCD1" + e), d), innerText($("dCD2" + e), d), oSym.addTask(50, arguments.callee, [(d - 0.5).toFixed(1), e])) 2126 - : (ClearChild($("dCD1" + e), $("dCD2" + e)), (ArCard[e].CDReady = 1), MonitorCard()); 2127 - })(b, c); 2128 - }), 2129 - (ChosePlant = function (h, d) { 2130 - // PlayAudio("seedlift"); 2131 - var g = ArCard[(oS.ChoseCard = d)]; 2132 - if (!(g.CDReady && g.SunReady)) { 2133 - PlayAudio("buzzer"); 2134 - return; 2280 + } else { 2281 + while (i--) { 2282 + card = ArCard[i]; 2283 + let proto = card.PName.prototype; 2284 + if (proto.SunNum > oS.SunNum) { 2285 + if (card.SunReady) card.SunReady = 0; 2286 + } else { 2287 + if (!card.SunReady) card.SunReady = 1; 2288 + } 2135 2289 } 2136 - PlayAudio("seedlift"); 2137 - h = window.event || h; 2138 - var b = h.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft; 2139 - var a = h.clientY + EBody.scrollTop || EElement.scrollTop; 2140 - var j = g.PName.prototype; 2141 - var e = ArCard.length; 2142 - var f; 2143 - var c = j.PicArr; 2144 - oS.Chose = 1; 2145 - !oS.CardKind 2146 - ? EditImg( 2147 - NewImg( 2148 - "MovePlant", 2149 - c[j.StaticGif], 2150 - "left:" + b - 0.5 * (j.beAttackedPointL + j.beAttackedPointR) + "px;top:" + a + 20 - j.height + "px;z-index:254", 2151 - EDAll 2152 - ).cloneNode(false), 2153 - "MovePlantAlpha", 2154 - "", 2155 - { 2156 - visibility: "hidden", 2157 - filter: "alpha(opacity=40)", 2158 - opacity: 0.4, 2159 - zIndex: 30, 2160 - }, 2161 - EDAll 2162 - ) 2163 - : (NewImg( 2164 - "MovePlant", 2165 - j.PicArr[j.StandGif], 2166 - "left:" + (b - 0.5 * (j.beAttackedPointL + j.beAttackedPointR)) + "px;top:" + (a + 20 - j.height) + "px;z-index:254", 2167 - EDAll 2168 - ), 2169 - NewImg("MovePlantAlpha", j.PicArr[j.StandGif], "visibility:hidden;filter:alpha(opacity=40);opacity:0.4;z-index:30", EDAll)); 2170 - while (e--) { 2171 - $(ArCard[e].DID).childNodes[0].style.filter = "grayscale(1) brightness(1.15)"; 2290 + } 2291 + ViewPlantTitle(oS.MCID); 2292 + }; 2293 + 2294 + var DoCoolTimer = function (index, duration) { 2295 + const ele = $(ArCard[index].DID); 2296 + NewEle("dCD1" + index, "span", "position:absolute;left:22px;top:22px;font-size:18px;font-weight:500;font-family:Verdana;color:#000", "", ele); 2297 + NewEle("dCD2" + index, "span", "position:absolute;left:20px;top:20px;font-size:18px;font-weight:500;font-family:Verdana;color:#FF0", "", ele); 2298 + 2299 + (function tick(timeLeft, idx) { 2300 + if (timeLeft > 0) { 2301 + innerText($("dCD1" + idx), timeLeft); 2302 + innerText($("dCD2" + idx), timeLeft); 2303 + oSym.addTask(50, tick, [(timeLeft - 0.5).toFixed(1), idx]); 2304 + } else { 2305 + ClearChild($("dCD1" + idx), $("dCD2" + idx)); 2306 + ArCard[idx].CDReady = 1; 2307 + MonitorCard(); 2172 2308 } 2173 - SetHidden($("dTitle")); 2174 - GroundOnmousemove = GroundOnmousemove1; 2175 - }), 2176 - (CancelPlant = function () { 2177 - ClearChild($("MovePlant"), $("MovePlantAlpha")); 2178 - oS.Chose = 0; 2179 - MonitorCard(); 2180 - GroundOnmousemove = function () {}; 2181 - }), 2182 - (ShovelPlant = function (a) { 2183 - PlayAudio("plant2"); 2184 - var b = a[0]; 2185 - var c = a[1]; 2186 - c && (c.PKind || !(b[1] || b[2])) && (c.Die(), (oS.MPID = "")); 2187 - CancelShovel(); 2188 - }), 2189 - (ChoseShovel = function (a) { 2190 - PlayAudio("shovel"); 2191 - WhichMouseButton(a) < 2 && 2192 - (SetHidden($("imgShovel")), 2309 + })(duration, index); 2310 + }; 2311 + 2312 + var ChosePlant = function (e, index) { 2313 + const card = ArCard[(oS.ChoseCard = index)]; 2314 + if (!(card.CDReady && card.SunReady)) { 2315 + PlayAudio("buzzer"); 2316 + return; 2317 + } 2318 + PlayAudio("seedlift"); 2319 + e = window.event || e; 2320 + const x = e.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft; 2321 + const y = e.clientY + EBody.scrollTop || EElement.scrollTop; 2322 + 2323 + const proto = card.PName.prototype; 2324 + const len = ArCard.length; 2325 + 2326 + oS.Chose = 1; 2327 + 2328 + if (!oS.CardKind) { 2329 + EditImg( 2193 2330 NewImg( 2194 - "tShovel", 2195 - "images/interface/Shovel/0.gif", 2196 - "left:" + (a.clientX - 10) + "px;top:" + (a.clientY + document.body.scrollTop - 17) + "px;z-index:1", 2331 + "MovePlant", 2332 + proto.PicArr[proto.StaticGif], 2333 + `left:${x - 0.5 * (proto.beAttackedPointL + proto.beAttackedPointR)}px;top:${y + 20 - proto.height}px;z-index:254`, 2197 2334 EDAll 2198 - ), 2199 - (oS.Chose = -1), 2200 - (GroundOnmousemove = GroundOnmousemove2), 2201 - StopBubble(a)); 2202 - }), 2203 - (CancelShovel = function (a) { 2204 - var b = oS.MPID; 2205 - ClearChild($("tShovel")); 2206 - oS.Chose = 0; 2207 - SetVisible($("imgShovel")); 2208 - b && SetAlpha($(b).childNodes[1], 100, 1); 2209 - GroundOnmousemove = function () {}; 2210 - }), 2211 - (StopBubble = function (a) { 2212 - window.event ? (event.cancelBubble = true) : a.stopPropagation(); 2213 - }), 2214 - (GrowPlant = function (l, d, c, e, b) { 2215 - var j = oS.ChoseCard; 2216 - var f = ArCard[j]; 2217 - var h = f.PName; 2218 - var k = h.prototype; 2219 - var i = k.coolTime; 2220 - var a; 2221 - var g = oGd.$LF[e]; 2335 + ).cloneNode(false), 2336 + "MovePlantAlpha", 2337 + "", 2338 + { visibility: "hidden", filter: "alpha(opacity=40)", opacity: 0.4, zIndex: 30 }, 2339 + EDAll 2340 + ); 2341 + } else { 2342 + NewImg( 2343 + "MovePlant", 2344 + proto.PicArr[proto.StandGif], 2345 + `left:${x - 0.5 * (proto.beAttackedPointL + proto.beAttackedPointR)}px;top:${y + 20 - proto.height}px;z-index:254`, 2346 + EDAll 2347 + ); 2348 + NewImg("MovePlantAlpha", proto.PicArr[proto.StandGif], "visibility:hidden;filter:alpha(opacity=40);opacity:0.4;z-index:30", EDAll); 2349 + } 2222 2350 2223 - // Check if the plant can grow at the selected location 2224 - if (k.CanGrow(l, e, b)) { 2225 - // Play planting audio based on soil type 2226 - PlayAudio(g !== 2 ? "plant" + Math.floor(1 + Math.random() * 2) : "plant_water"); 2351 + for (let i = 0; i < len; i++) { 2352 + $(ArCard[i].DID).childNodes[0].style.filter = "grayscale(1) brightness(1.15)"; 2353 + } 2354 + SetHidden($("dTitle")); 2355 + GroundOnmousemove = GroundOnmousemove1; 2356 + }; 2227 2357 2228 - // Plant the selected plant at the specified location 2229 - !oS.CardKind 2230 - ? new h().Birth(d, c, e, b, l) 2231 - : asyncInnerHTML( 2232 - (a = new h()).CustomBirth(e, b, 0, "auto"), 2233 - (n, m) => { 2234 - EDPZ.appendChild(n); 2235 - m.Birth(); 2236 - }, 2237 - a 2238 - ); 2358 + var CancelPlant = function () { 2359 + ClearChild($("MovePlant"), $("MovePlantAlpha")); 2360 + oS.Chose = 0; 2361 + MonitorCard(); 2362 + GroundOnmousemove = function () {}; 2363 + }; 2239 2364 2240 - // Deduct sun points based on plant's cost 2241 - innerText(ESSunNum, (oS.SunNum -= k.SunNum)); 2365 + var ShovelPlant = function (data) { 2366 + PlayAudio("plant2"); 2367 + const plants = data[0]; 2368 + const topPlant = data[1]; 2369 + if (topPlant && (topPlant.PKind || !(plants[1] || plants[2]))) { 2370 + topPlant.Die(); 2371 + oS.MPID = ""; 2372 + } 2373 + CancelShovel(); 2374 + }; 2242 2375 2243 - // Start cooldown timer for the plant 2244 - i && ((f.CDReady = 0), DoCoolTimer(j, k.coolTime)); 2376 + var ChoseShovel = function (e) { 2377 + PlayAudio("shovel"); 2378 + if (WhichMouseButton(e) < 2) { 2379 + SetHidden($("imgShovel")); 2380 + NewImg("tShovel", "images/interface/Shovel/0.gif", `left:${e.clientX - 10}px;top:${e.clientY + document.body.scrollTop - 17}px;z-index:1`, EDAll); 2381 + oS.Chose = -1; 2382 + GroundOnmousemove = GroundOnmousemove2; 2383 + StopBubble(e); 2384 + } 2385 + }; 2245 2386 2246 - // Show planting animation 2247 - oSym.addTask(20, SetHidden, [ 2248 - SetStyle(g !== 2 ? $("imgGrowSoil") : $("imgGrowSpray"), { 2249 - left: d - 30 + "px", 2250 - top: c - 30 + "px", 2251 - zIndex: 3 * e + 1, 2252 - visibility: "visible", 2253 - }), 2254 - ]); 2387 + var CancelShovel = function (e) { 2388 + const prevId = oS.MPID; 2389 + ClearChild($("tShovel")); 2390 + oS.Chose = 0; 2391 + SetVisible($("imgShovel")); 2392 + if (prevId) SetAlpha($(prevId).childNodes[1], 100, 1); 2393 + GroundOnmousemove = function () {}; 2394 + }; 2395 + 2396 + var StopBubble = function (e) { 2397 + window.event ? (event.cancelBubble = true) : e.stopPropagation(); 2398 + }; 2399 + 2400 + var GrowPlant = function (plants, c, r, rType, cType) { 2401 + const cardIdx = oS.ChoseCard; 2402 + const card = ArCard[cardIdx]; 2403 + const PlantClass = card.PName; 2404 + const proto = PlantClass.prototype; 2405 + const coolTime = proto.coolTime; 2406 + const laneType = oGd.$LF[rType]; 2255 2407 2256 - // List of seed plants 2257 - const seedPlants = [ 2258 - oSeedPeashooter, 2259 - oSeedSnowPea, 2260 - oSeedSquash, 2261 - oSeedPotatoMine, 2262 - oSeedWallNut, 2263 - oSeedRepeater2, 2264 - oSeedHypnoShroom, 2265 - oSeedPuffShroom, 2266 - oSeedPumpkinHead, 2267 - oSeedPlantern, 2268 - oSeedThreepeater, 2269 - oSeedTallNut, 2270 - oSeedTorchwood, 2271 - oSeedLilyPad, 2272 - oSeedCherryBomb, 2273 - oSeedChomper, 2274 - oSeedRepeater, 2275 - oSeedGarlic, 2276 - oSeedScaredyShroom, 2277 - oSeedBlover, 2278 - oSeedStarfruit, 2279 - oSeedCactus, 2280 - oSeedFumeShroom, 2281 - oSeedDoomShroom, 2282 - oSeedSeaShroom, 2283 - oSeedJalapeno, 2284 - oSeedTangleKelp, 2285 - oSeedIceShroom, 2286 - oSeedGloomShroom, 2287 - ]; 2288 - // Check if the chosen plant is a seed variant 2289 - if (seedPlants.includes(h)) { 2290 - // Hide the card instead of removing it 2291 - SetHidden($(f.DID)); 2292 - } 2408 + // Check if the plant can grow at the selected location 2409 + if (proto.CanGrow(plants, rType, cType)) { 2410 + // Play planting audio based on soil type 2411 + PlayAudio(laneType !== 2 ? "plant" + Math.floor(1 + Math.random() * 2) : "plant_water"); 2412 + 2413 + // Plant the selected plant at the specified location 2414 + if (!oS.CardKind) { 2415 + new PlantClass().Birth(c, r, rType, cType, plants); 2416 + } else { 2417 + let tempPlant = new PlantClass(); 2418 + asyncInnerHTML( 2419 + tempPlant.CustomBirth(rType, cType, 0, "auto"), 2420 + (ele, instance) => { 2421 + EDPZ.appendChild(ele); 2422 + instance.Birth(); 2423 + }, 2424 + tempPlant 2425 + ); 2293 2426 } 2294 2427 2295 - // Clear plant selection 2296 - CancelPlant(); 2297 - }); 2428 + // Deduct sun points 2429 + innerText(ESSunNum, (oS.SunNum -= proto.SunNum)); 2298 2430 2299 - (AutoProduceSun = function (a) { 2300 - // console.log("ROBLNET13 on github") 2301 - AppearSun(GetX(Math.floor(1 + Math.random() * oS.C)), GetY(Math.floor(1 + Math.random() * oS.R)), a, 1); 2302 - oSym.addTask(Math.floor(9 + Math.random() * 3) * 100, AutoProduceSun, [a]); 2303 - }), 2304 - (AppearSun = function (h, f, e, a) { 2305 - var b; 2306 - var d; 2307 - var g = "Sun" + Math.random(); 2308 - var c = "cursor:url(images/interface/Pointer.cur),pointer;z-index:25;left:" + h + "px;"; 2309 - switch (e) { 2310 - case 25: 2311 - c += "width:78px;height:78px"; 2312 - b = 39; 2313 - break; 2314 - case 15: 2315 - c += "width:46px;height:46px"; 2316 - b = 23; 2317 - break; 2318 - default: 2319 - c += "width:100px;height:100px"; 2320 - b = 55; 2431 + // Start cooldown 2432 + if (coolTime) { 2433 + card.CDReady = 0; 2434 + DoCoolTimer(cardIdx, coolTime); 2321 2435 } 2322 - a 2323 - ? ((d = 0), oSym.addTask(10, MoveDropSun, [g, f])) 2324 - : ((d = f - b - 20), 2325 - (c += ";top:" + d + "px"), 2326 - oSym.addTask( 2327 - 1, 2328 - function (q, p, n, j, l, k, m, i) { 2329 - if (ArSun[q] && ArSun[q].C) { 2330 - SetStyle($(q), { 2331 - left: (p += j * k) + "px", 2332 - top: (n += Number(l[0])) + "px", 2333 - }); 2334 - l.shift(); 2335 - --m; 2336 - m > 0 && (l.length === 0 && (l = [8, 16, 24, 32]), oSym.addTask(i, arguments.callee, [q, p, n, j, l, k, m, ++i])); 2337 - } 2338 - }, 2339 - [g, h, d, Math.floor(Math.random() * 4), [-32, -24, -16, -8], [-1, 1][Math.floor(Math.random() * 2)], 8, 2] 2340 - ), 2341 - oSym.addTask(800, DisappearSun, [g], 3)); 2342 - ArSun[g] = { id: g, N: e, C: 1, left: h, top: d }; 2343 - NewImg(g, "images/interface/Sun.webp", c, EDAll, { 2344 - onclick() { 2345 - ClickSun(this.id); 2346 - }, 2347 - }); 2348 - oS.AutoSun && oSym.addTask(100, ClickSun, [g]); 2349 - }), 2350 - (MoveDropSun = function (c, b) { 2351 - var a = ArSun[c]; 2352 - a && a.C && (a.top < b - 53 ? (($(c).style.top = (a.top += 3) + "px"), oSym.addTask(5, MoveDropSun, [c, b])) : oSym.addTask(800, DisappearSun, [c])); 2353 - }), 2354 - (DisappearSun = function (b) { 2355 - var a = ArSun[b]; 2356 - a && a.C && (delete ArSun[b], ClearChild($(b))); 2357 - }), 2358 - (ClickSun = function (b) { 2359 - PlayAudioLegacy("points"); 2360 - var a = ArSun[b]; 2361 - a && a.C && ((a.C = 0), oSym.addTask(0, MoveClickSun, [b])); 2362 - }), 2363 - (MoveClickSun = function (b) { 2364 - var a = 15; 2365 - var c = ArSun[b]; 2366 - var e = 85; 2367 - var i = -20; 2368 - var d = c.left; 2369 - var h = c.top; 2370 - var g = Math.round((d - e) / a); 2371 - var f = Math.round((h - i) / a); 2372 - (function (k, l, n, s, m, r, j, q, p) { 2373 - (m -= q) > n 2374 - ? (SetStyle($(k), { left: m + "px", top: (r -= p) + "px" }), oSym.addTask(j, arguments.callee, [k, l, n, s, m, r, (j += 0.3), q, p])) 2375 - : (SetStyle($(k), { left: n + "px", top: s + "px" }), 2376 - Number(ESSunNum.innerHTML) !== oS.SunNum && (oS.SunNum = Math.min(Number(ESSunNum.innerHTML), oS.SunNum)), 2377 - innerText(ESSunNum, (oS.SunNum = Math.min(oS.SunNum + l.N, 9990))), 2378 - MonitorCard(), 2379 - delete ArSun[k], 2380 - oSym.addTask(20, ClearChild, [$(k)])); 2381 - })(b, c, e, i, d, h, 1, g, f); 2382 - }), 2383 - (AutoClickSun = function () { 2384 - var a; 2385 - var b; 2386 - for (b in ArSun) { 2387 - ArSun[b].C && ClickSun(b); 2436 + 2437 + // Show planting animation 2438 + oSym.addTask(20, SetHidden, [ 2439 + SetStyle(laneType !== 2 ? $("imgGrowSoil") : $("imgGrowSpray"), { 2440 + left: c - 30 + "px", 2441 + top: r - 30 + "px", 2442 + zIndex: 3 * rType + 1, 2443 + visibility: "visible", 2444 + }), 2445 + ]); 2446 + 2447 + const seedPlants = [ 2448 + oSeedPeashooter, 2449 + oSeedSnowPea, 2450 + oSeedSquash, 2451 + oSeedPotatoMine, 2452 + oSeedWallNut, 2453 + oSeedRepeater2, 2454 + oSeedHypnoShroom, 2455 + oSeedPuffShroom, 2456 + oSeedPumpkinHead, 2457 + oSeedPlantern, 2458 + oSeedThreepeater, 2459 + oSeedTallNut, 2460 + oSeedTorchwood, 2461 + oSeedLilyPad, 2462 + oSeedCherryBomb, 2463 + oSeedChomper, 2464 + oSeedRepeater, 2465 + oSeedGarlic, 2466 + oSeedScaredyShroom, 2467 + oSeedBlover, 2468 + oSeedStarfruit, 2469 + oSeedCactus, 2470 + oSeedFumeShroom, 2471 + oSeedDoomShroom, 2472 + oSeedSeaShroom, 2473 + oSeedJalapeno, 2474 + oSeedTangleKelp, 2475 + oSeedIceShroom, 2476 + oSeedGloomShroom, 2477 + ]; 2478 + 2479 + if (seedPlants.includes(PlantClass)) { 2480 + SetHidden($(card.DID)); 2388 2481 } 2389 - }), 2390 - (ShowLargeWave = function (a) { 2391 - PlayAudio("hugewave"); 2392 - NewImg("LargeWave", "images/interface/LargeWave.gif", "left:71px;top:249px;width:400px;height:200px;z-index:50", EDAll); 2482 + } 2483 + 2484 + CancelPlant(); 2485 + }; 2486 + 2487 + var AutoProduceSun = function (amount) { 2488 + AppearSun(GetX(Math.floor(1 + Math.random() * oS.C)), GetY(Math.floor(1 + Math.random() * oS.R)), amount, 1); 2489 + oSym.addTask(Math.floor(9 + Math.random() * 3) * 100, AutoProduceSun, [amount]); 2490 + }; 2491 + 2492 + var AppearSun = function (x, y, amount, isDrop) { 2493 + let sizeDiff, endTop; 2494 + const id = "Sun" + Math.random(); 2495 + let style = `cursor:url(images/interface/Pointer.cur),pointer;z-index:25;left:${x}px;`; 2496 + 2497 + switch (amount) { 2498 + case 25: 2499 + style += "width:78px;height:78px"; 2500 + sizeDiff = 39; 2501 + break; 2502 + case 15: 2503 + style += "width:46px;height:46px"; 2504 + sizeDiff = 23; 2505 + break; 2506 + default: 2507 + style += "width:100px;height:100px"; 2508 + sizeDiff = 55; 2509 + } 2510 + 2511 + if (isDrop) { 2512 + endTop = 0; 2513 + oSym.addTask(10, MoveDropSun, [id, y]); 2514 + } else { 2515 + endTop = y - sizeDiff - 20; 2516 + style += ";top:" + endTop + "px"; 2517 + 2518 + // Parabolic arc movement for produced sun 2393 2519 oSym.addTask( 2394 - 4, 2395 - function (b, c, d) { 2396 - SetStyle($("LargeWave"), { 2397 - width: (b -= 57.2) + "px", 2398 - height: (c -= 6.8) + "px", 2399 - left: 500 - b * 0.5 + "px", 2400 - top: 300 - c * 0.5 + "px", 2401 - }); 2402 - b > 286 2403 - ? oSym.addTask(4, arguments.callee, [b, c, d]) 2404 - : (oSym.addTask( 2405 - 460, 2406 - () => { 2407 - ClearChild($("LargeWave")); 2408 - }, 2409 - [] 2410 - ), 2411 - d && d()); 2520 + 1, 2521 + function (sunId, curX, curY, xStep, ySteps, dir, stepsLeft, tick) { 2522 + if (ArSun[sunId] && ArSun[sunId].C) { 2523 + SetStyle($(sunId), { 2524 + left: (curX += xStep * dir) + "px", 2525 + top: (curY += Number(ySteps[0])) + "px", 2526 + }); 2527 + ySteps.shift(); 2528 + --stepsLeft; 2529 + if (stepsLeft > 0) { 2530 + if (ySteps.length === 0) ySteps = [8, 16, 24, 32]; 2531 + oSym.addTask(tick, arguments.callee, [sunId, curX, curY, xStep, ySteps, dir, stepsLeft, ++tick]); 2532 + } 2533 + } 2412 2534 }, 2413 - [858, 102, a] 2535 + [id, x, endTop, Math.floor(Math.random() * 4), [-32, -24, -16, -8], [-1, 1][Math.floor(Math.random() * 2)], 8, 2] 2414 2536 ); 2415 - }), 2416 - (ShowFinalWave = function () { 2417 - var a = function (b) { 2418 - PlayAudio("finalwave"); 2419 - NewImg("FinalWave", "images/interface/FinalWave.gif", "left:122px;top:194px;width:756px;height:213px;z-index:50", EDAll); 2420 - oSym.addTask( 2421 - 4, 2422 - function (c, e, d) { 2423 - SetStyle($("FinalWave"), { 2424 - width: (c -= 50.4) + "px", 2425 - height: (e -= 14.2) + "px", 2426 - left: 500 - c * 0.5 + "px", 2427 - top: 300 - e * 0.5 + "px", 2428 - }); 2429 - c > 252 2430 - ? oSym.addTask(4, arguments.callee, [c, e, d]) 2431 - : oSym.addTask(d, () => { 2432 - ClearChild($("FinalWave")); 2433 - }, []); 2434 - }, 2435 - [756, 213, b] 2436 - ); 2437 - }; 2438 - oP.FlagNum in oS.LargeWaveFlag 2439 - ? ShowLargeWave(() => { 2440 - oSym.addTask(560, a, [150]); 2441 - }) 2442 - : a(500); 2443 - }), 2444 - (ShowBOSS = function (a) { 2537 + oSym.addTask(800, DisappearSun, [id], 3); 2538 + } 2539 + 2540 + ArSun[id] = { id: id, N: amount, C: 1, left: x, top: endTop }; 2541 + NewImg(id, "images/interface/Sun.webp", style, EDAll, { 2542 + onclick() { 2543 + ClickSun(this.id); 2544 + }, 2545 + }); 2546 + 2547 + if (oS.AutoSun) oSym.addTask(100, ClickSun, [id]); 2548 + }; 2549 + 2550 + var MoveDropSun = function (id, targetY) { 2551 + const sun = ArSun[id]; 2552 + if (sun && sun.C) { 2553 + if (sun.top < targetY - 53) { 2554 + $(id).style.top = (sun.top += 3) + "px"; 2555 + oSym.addTask(5, MoveDropSun, [id, targetY]); 2556 + } else { 2557 + oSym.addTask(800, DisappearSun, [id]); 2558 + } 2559 + } 2560 + }; 2561 + 2562 + var DisappearSun = function (id) { 2563 + const sun = ArSun[id]; 2564 + if (sun && sun.C) { 2565 + delete ArSun[id]; 2566 + ClearChild($(id)); 2567 + } 2568 + }; 2569 + 2570 + var ClickSun = function (id) { 2571 + PlayAudioLegacy("points"); 2572 + const sun = ArSun[id]; 2573 + if (sun && sun.C) { 2574 + sun.C = 0; 2575 + oSym.addTask(0, MoveClickSun, [id]); 2576 + } 2577 + }; 2578 + 2579 + var MoveClickSun = function (id) { 2580 + const speed = 15; 2581 + const sun = ArSun[id]; 2582 + const destX = 85; 2583 + const destY = -20; 2584 + const startX = sun.left; 2585 + const startY = sun.top; 2586 + 2587 + const stepsX = Math.round((startX - destX) / speed); 2588 + const stepsY = Math.round((startY - destY) / speed); 2589 + 2590 + (function (elId, sunData, dX, dY, curX, curY, stepRate, stepX, stepY) { 2591 + if ((curX -= stepX) > dX) { 2592 + SetStyle($(elId), { left: curX + "px", top: (curY -= stepY) + "px" }); 2593 + oSym.addTask(stepRate, arguments.callee, [elId, sunData, dX, dY, curX, curY, (stepRate += 0.3), stepX, stepY]); 2594 + } else { 2595 + SetStyle($(elId), { left: dX + "px", top: dY + "px" }); 2596 + if (Number(ESSunNum.innerHTML) !== oS.SunNum) { 2597 + oS.SunNum = Math.min(Number(ESSunNum.innerHTML), oS.SunNum); 2598 + } 2599 + innerText(ESSunNum, (oS.SunNum = Math.min(oS.SunNum + sunData.N, 9990))); 2600 + MonitorCard(); 2601 + delete ArSun[elId]; 2602 + oSym.addTask(20, ClearChild, [$(elId)]); 2603 + } 2604 + })(id, sun, destX, destY, startX, startY, 1, stepsX, stepsY); 2605 + }; 2606 + 2607 + var AutoClickSun = function () { 2608 + for (let id in ArSun) { 2609 + if (ArSun[id].C) ClickSun(id); 2610 + } 2611 + }; 2612 + 2613 + var ShowLargeWave = function (callback) { 2614 + PlayAudio("hugewave"); 2615 + NewImg("LargeWave", "images/interface/LargeWave.gif", "left:71px;top:249px;width:400px;height:200px;z-index:50", EDAll); 2616 + oSym.addTask( 2617 + 4, 2618 + function (w, h, cb) { 2619 + SetStyle($("LargeWave"), { 2620 + width: (w -= 57.2) + "px", 2621 + height: (h -= 6.8) + "px", 2622 + left: 500 - w * 0.5 + "px", 2623 + top: 300 - h * 0.5 + "px", 2624 + }); 2625 + if (w > 286) { 2626 + oSym.addTask(4, arguments.callee, [w, h, cb]); 2627 + } else { 2628 + oSym.addTask(460, () => ClearChild($("LargeWave")), []); 2629 + if (cb) cb(); 2630 + } 2631 + }, 2632 + [858, 102, callback] 2633 + ); 2634 + }; 2635 + 2636 + var ShowFinalWave = function () { 2637 + const playAnim = function (delay) { 2445 2638 PlayAudio("finalwave"); 2446 - NewImg("ShowBOSS", "images/interface/BOSSWave.gif", "left:71px;top:249px;width:858px;height:102px;z-index:50", EDAll); 2639 + NewImg("FinalWave", "images/interface/FinalWave.gif", "left:122px;top:194px;width:756px;height:213px;z-index:50", EDAll); 2447 2640 oSym.addTask( 2448 2641 4, 2449 - function (b, c, d) { 2450 - SetStyle($("LargeWave"), { 2451 - width: (b -= 57.2) + "px", 2452 - height: (c -= 6.8) + "px", 2453 - left: 500 - b * 0.5 + "px", 2454 - top: 300 - c * 0.5 + "px", 2642 + function (w, h, duration) { 2643 + SetStyle($("FinalWave"), { 2644 + width: (w -= 50.4) + "px", 2645 + height: (h -= 14.2) + "px", 2646 + left: 500 - w * 0.5 + "px", 2647 + top: 300 - h * 0.5 + "px", 2455 2648 }); 2456 - b > 286 2457 - ? oSym.addTask(4, arguments.callee, [b, c, d]) 2458 - : (oSym.addTask( 2459 - 460, 2460 - () => { 2461 - ClearChild($("ShowBOSS")); 2462 - }, 2463 - [] 2464 - ), 2465 - d && d()); 2649 + if (w > 252) { 2650 + oSym.addTask(4, arguments.callee, [w, h, duration]); 2651 + } else { 2652 + oSym.addTask(duration, () => ClearChild($("FinalWave")), []); 2653 + } 2466 2654 }, 2467 - [858, 102, a] 2655 + [756, 213, delay] 2468 2656 ); 2469 - }), 2470 - (GameOver = function () { 2471 - PlayAudio("scream"); 2472 - NewImg("iGameOver", "images/interface/ZombiesWon.webp", "width:900px;height:600px;z-index:255", EDAll, { 2473 - onclick() { 2474 - SelectModal(oS.Lvl); 2475 - }, 2476 - }); 2477 - oSym.Stop(); 2478 - }), 2479 - (GameOverZombies = function (c, a) { 2480 - var b = oSym; 2481 - StopMusic(); 2482 - PlayAudioLegacy("losemusic"); 2483 - b.Stop(); 2484 - //innerText(c, "Speed"); 2485 - SetBlock($("dSurface"), $("dZombieFail")); 2486 - oSym.Stop(); 2487 - }), 2488 - (PrepareGrowPlants = function (a) { 2489 - var b = function () { 2490 - PlayAudio("readysetplant"); 2491 - oSym.addTask( 2492 - 60, 2493 - (d, c) => { 2494 - var e = d.style; 2495 - e.backgroundPosition = "0 -108px"; 2496 - oSym.addTask( 2497 - 40, 2498 - (g, h, f) => { 2499 - h.backgroundPosition = "0 -216px"; 2500 - oSym.addTask( 2501 - 100, 2502 - (j, i) => { 2503 - ClearChild(j); 2504 - i(); 2505 - }, 2506 - [g, f] 2507 - ); 2508 - }, 2509 - [d, e, c] 2510 - ); 2511 - }, 2512 - [ 2513 - NewEle( 2514 - 0, 2515 - "div", 2516 - "position:absolute;overflow:hidden;background:url(images/interface/PrepareGrowPlants.png) no-repeat;width:255px;height:108px;z-index:50;left:" + 2517 - (oS.W * 0.5 - 77) + 2518 - "px;top:" + 2519 - (oS.H * 0.5 - 54) + 2520 - "px", 2521 - 0, 2522 - EDAll 2523 - ), 2524 - a, 2525 - ] 2526 - ); 2527 - }; 2528 - oS.HaveFog ? oGd.MoveFogLeft(b) : b(); 2529 - }), 2530 - (CustomPlants = function (b, a, c) { 2531 - new ArCard[b].PName().Birth(GetX(c), GetY(a), a, c, []); 2532 - }), 2533 - (CustomSpecial = function (c, b, d, a) { 2534 - let plant = new c(); 2535 - plant.Birth(GetX(d), GetY(b), b, d, [], a); 2536 - return plant; 2537 - }), 2538 - (CheckAutoSun = function (a) { 2539 - PlayAudio("buttonclick"); 2540 - var b = a.checked ? 1 : 0; 2541 - if (b !== oS.AutoSun) { 2542 - oS.AutoSun = b; 2543 - localStorage.setItem("JSPVZAutoSun", b); 2544 - if (b) { 2545 - AutoClickSun(); 2657 + }; 2658 + 2659 + oP.FlagNum in oS.LargeWaveFlag ? ShowLargeWave(() => oSym.addTask(560, playAnim, [150])) : playAnim(500); 2660 + }; 2661 + 2662 + var ShowBOSS = function (callback) { 2663 + PlayAudio("finalwave"); 2664 + NewImg("ShowBOSS", "images/interface/BOSSWave.gif", "left:71px;top:249px;width:858px;height:102px;z-index:50", EDAll); 2665 + oSym.addTask( 2666 + 4, 2667 + function (w, h, cb) { 2668 + SetStyle($("LargeWave"), { 2669 + width: (w -= 57.2) + "px", 2670 + height: (h -= 6.8) + "px", 2671 + left: 500 - w * 0.5 + "px", 2672 + top: 300 - h * 0.5 + "px", 2673 + }); 2674 + if (w > 286) { 2675 + oSym.addTask(4, arguments.callee, [w, h, cb]); 2676 + } else { 2677 + oSym.addTask(460, () => ClearChild($("ShowBOSS")), []); 2678 + if (cb) cb(); 2546 2679 } 2547 - } 2680 + }, 2681 + [858, 102, callback] 2682 + ); 2683 + }; 2684 + 2685 + var GameOver = function () { 2686 + PlayAudio("scream"); 2687 + NewImg("iGameOver", "images/interface/ZombiesWon.webp", "width:900px;height:600px;z-index:255", EDAll, { 2688 + onclick() { 2689 + SelectModal(oS.Lvl); 2690 + }, 2548 2691 }); 2692 + oSym.Stop(); 2693 + }; 2549 2694 2550 - (GetNewCard = function (a, b, c) { 2695 + var GameOverZombies = function (c, a) { 2696 + StopMusic(); 2697 + PlayAudioLegacy("losemusic"); 2698 + oSym.Stop(); 2699 + SetBlock($("dSurface"), $("dZombieFail")); 2700 + oSym.Stop(); 2701 + }; 2702 + 2703 + var PrepareGrowPlants = function (callback) { 2704 + const run = function () { 2705 + PlayAudio("readysetplant"); 2706 + oSym.addTask( 2707 + 60, 2708 + (ele, cb) => { 2709 + const style = ele.style; 2710 + style.backgroundPosition = "0 -108px"; 2711 + oSym.addTask( 2712 + 40, 2713 + (e, s, c) => { 2714 + s.backgroundPosition = "0 -216px"; 2715 + oSym.addTask( 2716 + 100, 2717 + (el, call) => { 2718 + ClearChild(el); 2719 + call(); 2720 + }, 2721 + [e, c] 2722 + ); 2723 + }, 2724 + [ele, style, cb] 2725 + ); 2726 + }, 2727 + [ 2728 + NewEle( 2729 + 0, 2730 + "div", 2731 + `position:absolute;overflow:hidden;background:url(images/interface/PrepareGrowPlants.png) no-repeat;width:255px;height:108px;z-index:50;left:${oS.W * 0.5 - 77}px;top:${oS.H * 0.5 - 54}px`, 2732 + 0, 2733 + EDAll 2734 + ), 2735 + callback, 2736 + ] 2737 + ); 2738 + }; 2739 + oS.HaveFog ? oGd.MoveFogLeft(run) : run(); 2740 + }; 2741 + 2742 + var CustomPlants = function (idx, c, r) { 2743 + new ArCard[idx].PName().Birth(GetX(r), GetY(c), c, r, []); 2744 + }; 2745 + 2746 + var CustomSpecial = function (Class, r, c, args) { 2747 + let plant = new Class(); 2748 + plant.Birth(GetX(c), GetY(r), r, c, [], args); 2749 + return plant; 2750 + }; 2751 + 2752 + var CheckAutoSun = function (checkbox) { 2753 + PlayAudio("buttonclick"); 2754 + const val = checkbox.checked ? 1 : 0; 2755 + if (val !== oS.AutoSun) { 2756 + oS.AutoSun = val; 2757 + localStorage.setItem("JSPVZAutoSun", val); 2758 + if (val) AutoClickSun(); 2759 + } 2760 + }; 2761 + 2762 + var GetNewCard = function (ele, plantClass, nextLvl) { 2551 2763 StopMusic(); 2552 2764 PlayAudioLegacy("winmusic"); 2553 2765 oSym.Clear(); 2554 - SetStyle(a, { 2766 + SetStyle(ele, { 2555 2767 left: "350px", 2556 2768 top: "131px", 2557 2769 width: "200px", ··· 2559 2771 clip: "rect(0,auto,120px,0)", 2560 2772 cursor: "url(images/interface/Cursor.cur),default", 2561 2773 }).onclick = null; 2774 + 2562 2775 oSym.Init( 2563 - function (d, e) { 2564 - ++d < 100 2565 - ? (SetAlpha(e, d, d * 0.01), oSym.addTask(4, arguments.callee, [d, e])) 2566 - : (function () { 2567 - StopAudio("winmusic"); 2568 - PlayAudio("plantsgarden", true); 2569 - SetHidden(EDAll, $("dTop")); 2570 - var f = b.prototype; 2571 - $("iNewPlantCard").src = f.PicArr[f.CardGif]; 2572 - $("iNewPlantCard").style.width = 100 + "px"; 2573 - $("iNewPlantCard").style.height = 120 + "px"; 2574 - // $("iNewPlantCard").style.marginTop = 2575 - // 180 - f.height + "px"; 2576 - innerText($("dNewPlantName"), f.CName); 2577 - $("dNewPlantTooltip").innerHTML = f.Tooltip; 2578 - $("btnNextLevel").onclick = function () { 2579 - StopAudio("plantsgarden"); 2580 - SetHidden($("bMainMenu")); 2581 - SelectModal(c); 2582 - }; 2583 - SetStyle($("dNewPlant"), { 2584 - visibility: "visible", 2585 - zIndex: 255, 2586 - }); 2587 - SetVisible($("bMainMenu")); 2588 - })(); 2776 + function (opacity, element) { 2777 + if (++opacity < 100) { 2778 + SetAlpha(element, opacity, opacity * 0.01); 2779 + oSym.addTask(4, arguments.callee, [opacity, element]); 2780 + } else { 2781 + StopAudio("winmusic"); 2782 + PlayAudio("plantsgarden", true); 2783 + SetHidden(EDAll, $("dTop")); 2784 + 2785 + const proto = plantClass.prototype; 2786 + $("iNewPlantCard").src = proto.PicArr[proto.CardGif]; 2787 + $("iNewPlantCard").style.width = "100px"; 2788 + $("iNewPlantCard").style.height = "120px"; 2789 + innerText($("dNewPlantName"), proto.CName); 2790 + $("dNewPlantTooltip").innerHTML = proto.Tooltip; 2791 + 2792 + $("btnNextLevel").onclick = function () { 2793 + StopAudio("plantsgarden"); 2794 + SetHidden($("bMainMenu")); 2795 + SelectModal(nextLvl); 2796 + }; 2797 + 2798 + SetStyle($("dNewPlant"), { 2799 + visibility: "visible", 2800 + zIndex: 255, 2801 + }); 2802 + SetVisible($("bMainMenu")); 2803 + } 2589 2804 }, 2590 2805 [0, $("DivA")] 2591 2806 ); 2592 - }), 2593 - (getCookie1 = function (b, g) { 2594 - var d = document.cookie; 2595 - var f = d.split(";"); 2596 - var c = f.length; 2597 - var a; 2598 - var e; 2599 - var h; 2600 - while (c--) { 2601 - h = (a = f[c]).split("="); 2602 - if (h[0].replace(" ", "") === b) { 2603 - if ((e = h.length) === 2) { 2604 - return unescape(h[1]); 2605 - } 2606 - h.shift(); 2607 - h = h.join("=").split("&"); 2608 - if (g === undefined) { 2609 - return unescape(h); 2610 - } 2611 - e = h.length; 2612 - while (e--) { 2613 - if ((a = h[e].split("="))[0].replace(" ", "") === g) { 2614 - return unescape(a[1]); 2615 - } 2616 - } 2807 + }; 2808 + 2809 + var getCookie1 = function (key, subKey) { 2810 + const cookie = document.cookie; 2811 + const list = cookie.split(";"); 2812 + let i = list.length; 2813 + 2814 + while (i--) { 2815 + let entry = list[i].split("="); 2816 + if (entry[0].replace(" ", "") === key) { 2817 + if (entry.length === 2) return unescape(entry[1]); 2818 + 2819 + entry.shift(); 2820 + let subEntries = entry.join("=").split("&"); 2821 + if (subKey === undefined) return unescape(subEntries); 2822 + 2823 + let j = subEntries.length; 2824 + while (j--) { 2825 + let sub = subEntries[j].split("="); 2826 + if (sub[0].replace(" ", "") === subKey) return unescape(sub[1]); 2617 2827 } 2618 2828 } 2619 - return 0; 2620 - }), 2621 - (getCookie = function (b) { 2622 - var a = document.cookie.match(new RegExp("(^| )" + b + "=([^;]*)(;|$)")); 2623 - if (a != null) { 2624 - return unescape(a[2]); 2625 - } 2626 - return 0; 2627 - }), 2628 - (addCookie = function (b, d, e) { 2629 - var c = b + "=" + escape(d); 2630 - if (e) { 2631 - var a = new Date(); 2632 - a.setTime(a.getTime + e * 3600 * 1e3); 2633 - c += ";expire=" + a.toGMTString(); 2634 - } 2635 - document.cookie = c; 2636 - }), 2637 - (deleteCookie = function (a) { 2638 - document.cookie = a + "=0;"; 2639 - }), 2640 - (WordUTF8 = 2641 - '<div id="dLogo" style="position:absolute;width:900px;height:600px;z-index:1"><span id="commit" style="position: absolute;color: #ffffff0f;bottom: 0;user-select: none;"></span><div id="LogoWord" style="position:absolute;color:#FF0;top:300px;width:100%;height:100px"><span style="position:absolute;width:305px;height:150px;left:285px;top:5px;cursor:url(images/interface/Pointer.cur),pointer" onclick="PlayAudio(\'gravebutton\');SetBlock($(\'dSurface\'),$(\'iSurfaceBackground\'));ShowNameDiv();sa_event(\'clickstart0js\')"></span><div style="position:absolute;font-size:14px;left:660px;text-align:center;width:140px;top:185px;line-height:1.5;font-weight:bold"><span style="cursor:url(images/interface/Pointer.cur),pointer"><span id="" style=""></span></span></div></div><div style="position:absolute;width:74px;height:41px;left:807px;top:502px;cursor:url(images/interface/Pointer.cur),pointer;z-index:300" onclick="SetVisible($(\'dProcess\'))"></div><img src="" style="position:absolute;left:550px;top:-40px"></div>'); 2829 + } 2830 + return 0; 2831 + }; 2832 + 2833 + var getCookie = function (key) { 2834 + const match = document.cookie.match(new RegExp("(^| )" + key + "=([^;]*)(;|$)")); 2835 + if (match != null) return unescape(match[2]); 2836 + return 0; 2837 + }; 2838 + 2839 + var addCookie = function (key, val, expireHours) { 2840 + let str = key + "=" + escape(val); 2841 + if (expireHours) { 2842 + const date = new Date(); 2843 + date.setTime(date.getTime + expireHours * 3600 * 1e3); 2844 + str += ";expire=" + date.toGMTString(); 2845 + } 2846 + document.cookie = str; 2847 + }; 2848 + 2849 + var deleteCookie = function (key) { 2850 + document.cookie = key + "=0;"; 2851 + }; 2852 + 2853 + var WordUTF8 = `<div id="dLogo" style="position:absolute;width:900px;height:600px;z-index:1"><span id="commit" style="position: absolute;color: #ffffff0f;bottom: 0;user-select: none;"></span><div id="LogoWord" style="position:absolute;color:#FF0;top:300px;width:100%;height:100px"><span style="position:absolute;width:305px;height:150px;left:285px;top:5px;cursor:url(images/interface/Pointer.cur),pointer" onclick="PlayAudio('gravebutton');SetBlock($('dSurface'),$('iSurfaceBackground'));ShowNameDiv();"></span><div style="position:absolute;font-size:14px;left:660px;text-align:center;width:140px;top:185px;line-height:1.5;font-weight:bold"><span style="cursor:url(images/interface/Pointer.cur),pointer"><span id="" style=""></span></span></div></div><div style="position:absolute;width:74px;height:41px;left:807px;top:502px;cursor:url(images/interface/Pointer.cur),pointer;z-index:300" onclick="SetVisible($('dProcess'))"></div><img src="" style="position:absolute;left:550px;top:-40px"></div>`; 2642 2854 2643 - (ShowNameDiv = function () { 2855 + var ShowNameDiv = function () { 2644 2856 oSym.Start(); 2645 - (function (c) { 2646 - var b = c[0]; 2647 - var d = 3; 2648 - c.shift(); 2649 - while (d--) { 2650 - SetStyle(($("dNameDiv" + d).style.top = b[d] + "px")); 2857 + (function (config) { 2858 + let item = config[0]; 2859 + let i = 3; 2860 + config.shift(); 2861 + while (i--) { 2862 + SetStyle(($("dNameDiv" + i).style.top = item[i] + "px")); 2651 2863 } 2652 - c.length && oSym.addTask(b[3], arguments.callee, [c]); 2864 + if (config.length) oSym.addTask(item[3], arguments.callee, [config]); 2653 2865 })([ 2654 2866 [-260, 96, 136, 10], 2655 2867 [-94, 96, 136, 10], ··· 2659 2871 [-8, 136, 189, 17], 2660 2872 [-8, 134, 187, 10], 2661 2873 ]); 2662 - }), 2663 - (ShowLoginDiv = function () { 2664 - $User.isAuthorWebsite ? PlayAudio("tap") : GotoAuthorWebsite(""); 2665 - }), 2666 - (CheckLogin = function () { 2667 - var c = $("txtName").value; 2668 - var e = $("txtPass").value; 2669 - var a = /^\w{3,10}$/; 2670 - var b = /^[\u4e00-\u9fa5\w]{3,10}$/; 2671 - var d = /^\w{3,20}$/; 2672 - return !!((a.exec(c) || b.exec(c)) && d.exec(e)); 2673 - }), 2674 - (SelectModal = function (g) { 2675 - HiddenLevel(); 2676 - HiddenMiniGame(1); 2677 - HiddenRiddleGame(1); 2678 - StopMusic(); 2679 - PausedAudioArr = []; 2680 - g === undefined && (g = $User.Visitor.Progress); 2681 - oS.LvlClearFunc && oS.LvlClearFunc(); 2682 - var b = oS.GlobalVariables; 2683 - var c = oS.LvlVariables; 2684 - var e = oS.SelfVariables; 2685 - var a = window; 2686 - var d; 2687 - for (d in b) { 2688 - a[d] = b[d]; 2689 - } 2690 - for (d in c) { 2691 - a[d] = null; 2692 - } 2693 - for (d = e.length; d--; delete oS[e[d]]) {} 2694 - for (d in $Pn) { 2695 - $Pn[d] = null; 2696 - } 2697 - oS.GlobalVariables = {}; 2698 - oS.LvlVariables = {}; 2699 - oS.SelfVariables.length = 0; 2700 - SetHidden($("dCardList"), $("tGround"), $("dSelectCard"), $("dTop"), $("dMenu"), $("dHandBook"), $("dNewPlant"), $("dProcess")); 2701 - SetNone($("dSurface"), $("iSurfaceBackground")); 2702 - ClearChild($("dFlagMeterTitleB").firstChild); 2703 - EDAll = $("dBody").replaceChild(EDNewAll, EDAll); 2704 - $("dBody").replaceChild(EDNewFlagMeter, $("dFlagMeter")); 2705 - LoadLvl(g); 2706 - }), 2707 - (GotoAuthorWebsite = function () { 2708 - window.open("https://github.com/ROBlNET13/pvz"); 2709 - }), 2710 - (InitGame = function () { 2711 - var e = NewEle( 2712 - "dServer", 2713 - "div", 2714 - "position:absolute;line-height:28px;left:706px;top:245px;width:700px;height:100px;font-size:16px;color:#040;font-family:Tahoma;font-weight:bold;z-index:2;display:none", 2715 - 0, 2716 - $("dAll") 2874 + }; 2875 + 2876 + var ShowLoginDiv = function () { 2877 + $User.isAuthorWebsite ? PlayAudio("tap") : GotoAuthorWebsite(""); 2878 + }; 2879 + 2880 + var CheckLogin = function () { 2881 + const user = $("txtName").value; 2882 + const pass = $("txtPass").value; 2883 + const regUser1 = /^\w{3,10}$/; 2884 + const regUser2 = /^[\u4e00-\u9fa5\w]{3,10}$/; 2885 + const regPass = /^\w{3,20}$/; 2886 + return !!((regUser1.exec(user) || regUser2.exec(user)) && regPass.exec(pass)); 2887 + }; 2888 + 2889 + var SelectModal = function (level) { 2890 + HiddenLevel(); 2891 + HiddenMiniGame(1); 2892 + HiddenRiddleGame(1); 2893 + StopMusic(); 2894 + PausedAudioArr = []; 2895 + 2896 + if (level === undefined) level = $User.Visitor.Progress; 2897 + if (oS.LvlClearFunc) oS.LvlClearFunc(); 2898 + // check if loadedMenus exists - if it does, clear it 2899 + if (window.loadedMenus) { 2900 + window.loadedMenus.length = 0; 2901 + } 2902 + 2903 + const globals = oS.GlobalVariables; 2904 + const lvls = oS.LvlVariables; 2905 + const selfs = oS.SelfVariables; 2906 + const win = window; 2907 + 2908 + for (let key in globals) win[key] = globals[key]; 2909 + for (let key in lvls) win[key] = null; 2910 + let i = selfs.length; 2911 + while (i--) delete oS[selfs[i]]; 2912 + for (let key in $Pn) $Pn[key] = null; 2913 + 2914 + oS.GlobalVariables = {}; 2915 + oS.LvlVariables = {}; 2916 + oS.SelfVariables.length = 0; 2917 + 2918 + SetHidden($("dCardList"), $("tGround"), $("dSelectCard"), $("dTop"), $("dMenu"), $("dHandBook"), $("dNewPlant"), $("dProcess")); 2919 + SetNone($("dSurface"), $("iSurfaceBackground")); 2920 + ClearChild($("dFlagMeterTitleB").firstChild); 2921 + 2922 + EDAll = $("dBody").replaceChild(EDNewAll, EDAll); 2923 + $("dBody").replaceChild(EDNewFlagMeter, $("dFlagMeter")); 2924 + LoadLvl(level); 2925 + }; 2926 + 2927 + var GotoAuthorWebsite = function () { 2928 + window.open("https://github.com/ROBlNET13/pvz"); 2929 + }; 2930 + 2931 + var InitGame = function () { 2932 + const serverDiv = NewEle( 2933 + "dServer", 2934 + "div", 2935 + "position:absolute;line-height:28px;left:706px;top:245px;width:700px;height:100px;font-size:16px;color:#040;font-family:Tahoma;font-weight:bold;z-index:2;display:none", 2936 + 0, 2937 + $("dAll") 2938 + ); 2939 + const procDiv = $("dProcess"); 2940 + 2941 + if (!$("dText1")) { 2942 + procDiv.insertBefore( 2943 + NewEle( 2944 + "dText1", 2945 + "div", 2946 + 0, 2947 + { 2948 + innerHTML: atob( 2949 + "PHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7Y29sb3I6I2JiYjt3aWR0aDo4NSU7ZGlzcGxheTpibG9jazttYXJnaW46MTVweCBhdXRvIDAgYXV0byI+PHNwYW4gc3R5bGU9ImNvbG9yOiNmNjA7Ij5XZWxjb21lIHRvIFBsYW50cyB2cy4gWm9tYmllczogTU9EREVEPGJyPjwvc3Bhbj48c3BhbiBzdHlsZT0iY29sb3I6I2VlZTsiPlBsYW50cyB2cy4gWm9tYmllcyBNT0RERUQgJmNvcHk7IDIwMjUgYnkgUk9CbE5FVDEzIGlzIGxpY2Vuc2VkIHVuZGVyIDxhIGhyZWY9Imh0dHBzOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9ieS1uYy1uZC80LjAvZGVlZC5lbiI+Q0MgQlktTkMtTkQgNC4wPC9hPi4gVGhpcyBsaWNlbnNlIGFwcGxpZXMgb25seSB0byBvcmlnaW5hbCBjb2RlL2NvbnRlbnQgY3JlYXRlZCBieSB0aGUgbW9kZGluZyB0ZWFtLiBBbGwgUGxhbnRzIHZzLiBab21iaWVzIGludGVsbGVjdHVhbCBwcm9wZXJ0eSByZW1haW5zIHRoZSBleGNsdXNpdmUgcHJvcGVydHkgb2YgUG9wQ2FwIEdhbWVzIGFuZCBFbGVjdHJvbmljIEFydHMgKEVBKS48L3NwYW4+PGJyPjxicj5QbGFudHMgdnMuIFpvbWJpZXMgTU9EREVEIGlzIGFuIHVub2ZmaWNpYWwgbW9kaWZpY2F0aW9uIGFuZCBpcyBub3QgYWZmaWxpYXRlZCB3aXRoLCBlbmRvcnNlZCBieSwgb3IgYXNzb2NpYXRlZCB3aXRoIFBvcENhcCBHYW1lcywgRWxlY3Ryb25pYyBBcnRzIChFQSksIG9yIHRoZSBvZmZpY2lhbCBQbGFudHMgdnMuIFpvbWJpZXMgZ2FtZS4gQWxsIGludGVsbGVjdHVhbCBwcm9wZXJ0eSwgdHJhZGVtYXJrcywgYW5kIGNvcHlyaWdodHMgcmVsYXRlZCB0byB0aGUgb3JpZ2luYWwgUGxhbnRzIHZzLiBab21iaWVzIGdhbWUgYXJlIHRoZSBwcm9wZXJ0eSBvZiBQb3BDYXAgR2FtZXMgYW5kIEVBLiBBbGwgY29kZSBpbiB0aGlzIGZhbmdhbWUgaXMgb3JpZ2luYWwsIGJhc2VkIG9uIGEgUHZaIHdlYmdhbWUgb3JpZ2luYWxseSBjcmVhdGVkIGJ5IEppYW5nTmFuIEdhbWUgRGV2ZWxvcG1lbnQgQ29tcGFueSBhbmQgTG9uZWx5U3Rhci4gVGhpcyBtb2QgZG9lcyBub3QgdXNlIGFueSBjb2RlIHdyaXR0ZW4gb3Igb3duZWQgYnkgUG9wQ2FwIEdhbWVzIG9yIEVBLiBUaGlzIG1vZCBpcyBjcmVhdGVkIGJ5IGZhbnMgZm9yIGVudGVydGFpbm1lbnQgcHVycG9zZXMgb25seSwgYW5kIG5vIGNvbW1lcmNpYWwgZ2FpbiBpcyBzb3VnaHQgb3Igb2J0YWluZWQgZnJvbSBpdHMgZGlzdHJpYnV0aW9uLiBVc2Ugb2YgdGhpcyBtb2QgaXMgYXQgeW91ciBvd24gcmlzaywgYW5kIHRoZSBjcmVhdG9ycyBvZiB0aGUgbW9kIGFyZSBub3QgbGlhYmxlIGZvciBhbnkgZGFtYWdlcyBvciBpc3N1ZXMgdGhhdCBtYXkgYXJpc2UgZnJvbSBpdHMgdXNlLjxicj48YnI+VXNlcyBvZiB0aGUgUG9wQ2FwIEdhbWVzIG9yIEVsZWN0cm9uaWMgQXJ0cyAoRUEpIG5hbWVzIGFyZSBmb3IgaWRlbnRpZmljYXRpb24gcHVycG9zZXMgb25seSBhbmQgZG8gbm90IGltcGx5IGFuIGVuZG9yc2VtZW50IGJ5IFBvcENhcCBHYW1lcyBvciBFQS48YnI+PGJyPjx1PkRvIG5vdCByZW1vdmUgdGhpcyB3YXJuaW5nLjwvdT4gRG9pbmcgc28gPHNwYW4gc3R5bGU9ImNvbG9yOnJlZCI+dmlvbGF0ZXM8L3NwYW4+IHRoZSB0ZXJtcyBvZiB0aGUgbGVnYWxseS1iaW5kaW5nIENyZWF0aXZlIENvbW1vbnMgTGljZW5zZSwgaWYgb3JpZ2luYWwgY29kZS9jb250ZW50IGNyZWF0ZWQgYnkgdGhlIG1vZGRpbmcgdGVhbSBpcyBpbmNsdWRlZC48YnI+PGJyPjxiPklmIHJlcXVlc3RlZCBieSBhbiBvZmZpY2lhbCBzb3VyY2UsIHdlIHdpbGwgcHJvbXB0bHkgdGFrZSBkb3duIHRoaXMgZmFuIGdhbWUgYW5kIHRoZSBhc3NvY2lhdGVkIEdpdEh1YiByZXBvLiBZb3UgbWF5IGNvbnRhY3QgdXMgdXNpbmcgdGhlIGVtYWlsIGxpc3RlZCBvbiA8YSBocmVmPSJodHRwczovL2dpdGh1Yi5jb20vUk9CbE5FVDEzL3B2ei9ibG9iL21haW4vUkVBRE1FLm1kI2xlZ2FsLWluZm8iPmh0dHBzOi8vZ2l0aHViLmNvbS9ST0JsTkVUMTMvcHZ6L2Jsb2IvbWFpbi9SRUFETUUubWQjbGVnYWwtaW5mbzwvYT4uPC9iPjwvc3Bhbj4=" 2950 + ), 2951 + }, 2952 + 0 2953 + ), 2954 + procDiv.firstChild 2717 2955 ); 2718 - var c = $User.Server; 2719 - var b = c.List; 2720 - var a = $("dProcess"); 2721 - var floor = oS.B; 2722 - !$("dText1") && 2723 - a.insertBefore( 2724 - NewEle( 2725 - "dText1", 2726 - "div", 2727 - 0, 2728 - { 2729 - innerHTML: floor( 2730 - "PHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7Y29sb3I6I2JiYjt3aWR0aDo4NSU7ZGlzcGxheTpibG9jazttYXJnaW46MTVweCBhdXRvIDAgYXV0byI+PHNwYW4gc3R5bGU9ImNvbG9yOiNmNjA7Ij5XZWxjb21lIHRvIFBsYW50cyB2cy4gWm9tYmllczogTU9EREVEPGJyPjwvc3Bhbj48c3BhbiBzdHlsZT0iY29sb3I6I2VlZTsiPlBsYW50cyB2cy4gWm9tYmllcyBNT0RERUQgJmNvcHk7IDIwMjUgYnkgUk9CbE5FVDEzIGlzIGxpY2Vuc2VkIHVuZGVyIDxhIGhyZWY9Imh0dHBzOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9ieS1uYy1uZC80LjAvZGVlZC5lbiI+Q0MgQlktTkMtTkQgNC4wPC9hPi4gVGhpcyBsaWNlbnNlIGFwcGxpZXMgb25seSB0byBvcmlnaW5hbCBjb2RlL2NvbnRlbnQgY3JlYXRlZCBieSB0aGUgbW9kZGluZyB0ZWFtLiBBbGwgUGxhbnRzIHZzLiBab21iaWVzIGludGVsbGVjdHVhbCBwcm9wZXJ0eSByZW1haW5zIHRoZSBleGNsdXNpdmUgcHJvcGVydHkgb2YgUG9wQ2FwIEdhbWVzIGFuZCBFbGVjdHJvbmljIEFydHMgKEVBKS48L3NwYW4+PGJyPjxicj5QbGFudHMgdnMuIFpvbWJpZXMgTU9EREVEIGlzIGFuIHVub2ZmaWNpYWwgbW9kaWZpY2F0aW9uIGFuZCBpcyBub3QgYWZmaWxpYXRlZCB3aXRoLCBlbmRvcnNlZCBieSwgb3IgYXNzb2NpYXRlZCB3aXRoIFBvcENhcCBHYW1lcywgRWxlY3Ryb25pYyBBcnRzIChFQSksIG9yIHRoZSBvZmZpY2lhbCBQbGFudHMgdnMuIFpvbWJpZXMgZ2FtZS4gQWxsIGludGVsbGVjdHVhbCBwcm9wZXJ0eSwgdHJhZGVtYXJrcywgYW5kIGNvcHlyaWdodHMgcmVsYXRlZCB0byB0aGUgb3JpZ2luYWwgUGxhbnRzIHZzLiBab21iaWVzIGdhbWUgYXJlIHRoZSBwcm9wZXJ0eSBvZiBQb3BDYXAgR2FtZXMgYW5kIEVBLiBBbGwgY29kZSBpbiB0aGlzIGZhbmdhbWUgaXMgb3JpZ2luYWwsIGJhc2VkIG9uIGEgUHZaIHdlYmdhbWUgb3JpZ2luYWxseSBjcmVhdGVkIGJ5IEppYW5nTmFuIEdhbWUgRGV2ZWxvcG1lbnQgQ29tcGFueSBhbmQgTG9uZWx5U3Rhci4gVGhpcyBtb2QgZG9lcyBub3QgdXNlIGFueSBjb2RlIHdyaXR0ZW4gb3Igb3duZWQgYnkgUG9wQ2FwIEdhbWVzIG9yIEVBLiBUaGlzIG1vZCBpcyBjcmVhdGVkIGJ5IGZhbnMgZm9yIGVudGVydGFpbm1lbnQgcHVycG9zZXMgb25seSwgYW5kIG5vIGNvbW1lcmNpYWwgZ2FpbiBpcyBzb3VnaHQgb3Igb2J0YWluZWQgZnJvbSBpdHMgZGlzdHJpYnV0aW9uLiBVc2Ugb2YgdGhpcyBtb2QgaXMgYXQgeW91ciBvd24gcmlzaywgYW5kIHRoZSBjcmVhdG9ycyBvZiB0aGUgbW9kIGFyZSBub3QgbGlhYmxlIGZvciBhbnkgZGFtYWdlcyBvciBpc3N1ZXMgdGhhdCBtYXkgYXJpc2UgZnJvbSBpdHMgdXNlLjxicj48YnI+VXNlcyBvZiB0aGUgUG9wQ2FwIEdhbWVzIG9yIEVsZWN0cm9uaWMgQXJ0cyAoRUEpIG5hbWVzIGFyZSBmb3IgaWRlbnRpZmljYXRpb24gcHVycG9zZXMgb25seSBhbmQgZG8gbm90IGltcGx5IGFuIGVuZG9yc2VtZW50IGJ5IFBvcENhcCBHYW1lcyBvciBFQS48YnI+PGJyPjx1PkRvIG5vdCByZW1vdmUgdGhpcyB3YXJuaW5nLjwvdT4gRG9pbmcgc28gPHNwYW4gc3R5bGU9ImNvbG9yOnJlZCI+dmlvbGF0ZXM8L3NwYW4+IHRoZSB0ZXJtcyBvZiB0aGUgbGVnYWxseS1iaW5kaW5nIENyZWF0aXZlIENvbW1vbnMgTGljZW5zZSwgaWYgb3JpZ2luYWwgY29kZS9jb250ZW50IGNyZWF0ZWQgYnkgdGhlIG1vZGRpbmcgdGVhbSBpcyBpbmNsdWRlZC48YnI+PGJyPjxiPklmIHJlcXVlc3RlZCBieSBhbiBvZmZpY2lhbCBzb3VyY2UsIHdlIHdpbGwgcHJvbXB0bHkgdGFrZSBkb3duIHRoaXMgZmFuIGdhbWUgYW5kIHRoZSBhc3NvY2lhdGVkIEdpdEh1YiByZXBvLiBZb3UgbWF5IGNvbnRhY3QgdXMgdXNpbmcgdGhlIGVtYWlsIGxpc3RlZCBvbiA8YSBocmVmPSJodHRwczovL2dpdGh1Yi5jb20vUk9CbE5FVDEzL3B2ei9ibG9iL21haW4vUkVBRE1FLm1kI2xlZ2FsLWluZm8iPmh0dHBzOi8vZ2l0aHViLmNvbS9ST0JsTkVUMTMvcHZ6L2Jsb2IvbWFpbi9SRUFETUUubWQjbGVnYWwtaW5mbzwvYT4uPC9iPjwvc3Bhbj4=" 2731 - ), 2732 - }, 2733 - 0 2734 - ), 2735 - a.firstChild 2956 + } 2957 + LoadLvl(); 2958 + // check if izl_id query parameter exists 2959 + const urlParams = new URLSearchParams(window.location.search); 2960 + const izlId = urlParams.get("izl_id"); 2961 + if (izlId) { 2962 + setTimeout(() => { 2963 + fetch(`${$User.Server.URL}/api/levels/${izlId}/download`, { 2964 + method: "GET", 2965 + }) 2966 + .then((response) => response.arrayBuffer()) 2967 + .then(async (arrayBuffer) => { 2968 + // load the level 2969 + const levelData = await fileToLevelData(arrayBuffer); 2970 + console.log(levelData); 2971 + levelDataToLoad = levelData[0] === "=" ? parseCloneTiny_OLD(levelData) : parseCloneTiny(levelData); 2972 + // load the izombiecustomlevel level 2973 + if (levelDataToLoad.lfValue[3] === 2) { 2974 + SelectModal("izombiecustomlevelwater"); 2975 + } else { 2976 + SelectModal("izombiecustomlevelnormal"); 2977 + } 2978 + }) 2979 + .catch((e) => { 2980 + console.error(e); 2981 + alert("There was an error loading the level. Please try again later."); 2982 + LoadLvl(); 2983 + }); 2984 + }, 0); 2985 + } 2986 + }; 2987 + 2988 + var LoadLvl = function (level, startTime) { 2989 + if (oSym.Timer) oSym.Stop(); 2990 + const isReplay = oSym.Now === startTime; 2991 + const user = $User; 2992 + 2993 + if (oS.CenterContent && ((level === 0 && isReplay) || level !== 0)) { 2994 + oS.DisplayAD = true; 2995 + } 2996 + 2997 + level = level || 0; 2998 + if ($("dServer") && level !== 0) SetNone($("dServer")); 2999 + 3000 + oSym.Init( 3001 + (lvl) => { 3002 + const script = $("JSPVZ"); 3003 + if (script) ClearChild(script); 3004 + NewEle( 3005 + "JSPVZ", 3006 + "script", 3007 + 0, 3008 + { 3009 + src: "level/" + (oS.Lvl = lvl) + ".js", 3010 + type: "text/javascript", 3011 + }, 3012 + document.getElementsByTagName("head").item(0) 2736 3013 ); 2737 - LoadLvl(); 2738 - }), 2739 - (LoadLvl = function (e, c) { 2740 - oSym.Timer && oSym.Stop(); 2741 - var b = oSym.Now === c; 2742 - var d = $User; 2743 - var a = d.Visitor; 2744 - oS.CenterContent && ((e === 0 && b) || e !== 0) && (oS.DisplayAD = true); 2745 - e = e || 0; 2746 - $("dServer") && e !== 0 && SetNone($("dServer")); 2747 - oSym.Init( 2748 - (g, f) => { 2749 - (f = $("JSPVZ")) && ClearChild(f); 2750 - NewEle( 2751 - "JSPVZ", 2752 - "script", 2753 - 0, 2754 - { 2755 - src: "level/" + (oS.Lvl = g) + ".js", 2756 - type: "text/javascript", 2757 - }, 2758 - document.getElementsByTagName("head").item(0) 2759 - ); 2760 - }, 2761 - [e && b ? 0 : e] 2762 - ); 2763 - /* $("aLvlLink").href = 2764 - "html/2-1" + (e && !isNaN(e) ? "-" + e : "") + ".htm"; */ 2765 - }), 2766 - (AppearTombstones = function (n, e, m) { 2767 - var r = oGd.$Tombstones; 2768 - var k = []; 2769 - var h = oS.R + 1; 2770 - var b; 2771 - var d = 0; 2772 - var q; 2773 - var a; 2774 - var g; 2775 - var f; 2776 - var s = oGd.$; 2777 - var l; 2778 - var p; 2779 - while (--h) { 2780 - g = e; 2781 - while (g >= n) { 2782 - !r[h + "_" + g] && (k[d++] = [h, g]); 2783 - --g; 2784 - } 3014 + }, 3015 + [level && isReplay ? 0 : level] 3016 + ); 3017 + }; 3018 + 3019 + var AppearTombstones = function (minR, maxR, count) { 3020 + const tombs = oGd.$Tombstones; 3021 + const candidates = []; 3022 + let r = oS.R + 1; 3023 + 3024 + // Find valid locations 3025 + while (--r) { 3026 + let c = maxR; 3027 + while (c >= minR) { 3028 + if (!tombs[r + "_" + c]) candidates.push([r, c]); 3029 + --c; 2785 3030 } 2786 - while (m--) { 2787 - q = k[(g = Math.floor(Math.random() * k.length))]; 2788 - r[(p = (h = q[0]) + "_" + (b = q[1]))] = 1; 2789 - for (f = 0; f < 4; f++) { 2790 - (l = s[p + "_" + f]) && l.Die(); 2791 - } 2792 - k.splice(g, 1); 2793 - a = NewEle( 2794 - "dTombstones" + h + "_" + b, 2795 - "div", 2796 - "position:absolute;width:86px;height:91px;left:" + (GetX(b) - 43) + "px;top:" + (GetY(h) - 91) + "px", 2797 - 0, 2798 - EDAll 2799 - ); 2800 - h = Math.floor(Math.random() * 4); 2801 - b = Math.floor(Math.random() * 2); 2802 - var c; 2803 - a.appendChild( 2804 - (c = NewEle("", "div", "background-position:-" + 86 * h + "px -" + 91 * b + "px", { className: "Tom1" }, a).cloneNode(false)) 2805 - ).className = "Tom2"; 3031 + } 3032 + 3033 + while (count--) { 3034 + let randIdx = Math.floor(Math.random() * candidates.length); 3035 + let coord = candidates[randIdx]; 3036 + let tr = coord[0]; 3037 + let tc = coord[1]; 3038 + let key = tr + "_" + tc; 3039 + 3040 + tombs[key] = 1; 3041 + 3042 + // Kill existing plants at location 3043 + for (let i = 0; i < 4; i++) { 3044 + let p = oGd.$[key + "_" + i]; 3045 + if (p) p.Die(); 2806 3046 } 2807 - }), 2808 - (ResetGame = function (b) { 2809 - AllAudioPauseCanceled(); 2810 - var a = oSym; 2811 - a.Start(); 2812 - innerText(b, "Speed"); 2813 - $("dMenu1").onclick = ClickMenu; 2814 - $("dMenu0").onclick = ShowSpeed; 2815 - SetNone($("dSurface"), $("dPause")); 2816 - $("dPauseAD").innerHTML = ""; 2817 - }), 2818 - (PauseGame = function (c, a) { 2819 - var b = oSym; 3047 + 3048 + candidates.splice(randIdx, 1); 3049 + 3050 + const div = NewEle("dTombstones" + key, "div", `position:absolute;width:86px;height:91px;left:${GetX(tc) - 43}px;top:${GetY(tr) - 91}px`, 0, EDAll); 3051 + const bgX = Math.floor(Math.random() * 4); 3052 + const bgY = Math.floor(Math.random() * 2); 3053 + 3054 + div.appendChild(NewEle("", "div", `background-position:-${86 * bgX}px -${91 * bgY}px`, { className: "Tom1" }, div).cloneNode(false)).className = "Tom2"; 3055 + } 3056 + }; 3057 + 3058 + var ResetGame = function (menuBtn) { 3059 + AllAudioPauseCanceled(); 3060 + oSym.Start(); 3061 + innerText(menuBtn, "Speed"); 3062 + $("dMenu1").onclick = ClickMenu; 3063 + $("dMenu0").onclick = ShowSpeed; 3064 + SetNone($("dSurface"), $("dPause")); 3065 + $("dPauseAD").innerHTML = ""; 3066 + }; 3067 + 3068 + var PauseGame = function (menuBtn, showAd) { 3069 + AllAudioPaused(); 3070 + oSym.Stop(); 3071 + innerText(menuBtn, "Speed"); 3072 + $("dMenu1").onclick = null; 3073 + $("dMenu0").onclick = null; 3074 + if (!showAd) SetBlock($("dSurface"), $("dPause")); 3075 + }; 3076 + 3077 + var ClickMenu = function (e, btn) { 3078 + if (oSym.Timer) { 2820 3079 AllAudioPaused(); 2821 - b.Stop(); 2822 - innerText(c, "Speed"); 2823 - $("dMenu1").onclick = null; 2824 - $("dMenu0").onclick = null; 2825 - !a && SetBlock($("dSurface"), $("dPause")); 2826 - }), 2827 - (ClickMenu = function (b, a) { 2828 - oSym.Timer && (AllAudioPaused(), PlayAudio("pause"), oSym.Stop(), SetBlock($("dSurface")), innerText($("dMenu0"), "Speed"), ShowOptions()); 2829 - document.getElementById("sOptionsMenu").textContent = "Back To Game"; 2830 - if (ArCard[oS.ChoseCard] && ArCard[oS.ChoseCard].DID != null) { 2831 - CancelPlant(); 2832 - } 2833 - }), 2834 - (OptionsMenuDown = function (b, a) { 2835 - b.className = "OptionsMenuButtonDown"; 2836 - a.style.paddingTop = "2px"; 2837 - }), 2838 - (OptionsMenuUP = function (b, a) { 2839 - b.className = "OptionsMenuButton"; 2840 - a.style.paddingTop = "0px"; 2841 - }), 2842 - (ShowSpeed = function () { 2843 - var b = oSym; 2844 - b.Stop(); 2845 - PlayAudio("gravebutton"); 2846 - SetNone($("dOptionsMenuback"), $("dOptionsMenu")); 2847 - SetBlock($("dSpeedContainer")); 2848 - }), 2849 - (HiddenSpeed = function () { 2850 - PlayAudio("tap"); 2851 - SetNone($("dSpeedContainer")); 2852 - oS.Lvl && ResetGame($("dMenu0")); 2853 - }), 2854 - (CSpeed = function (a, c, b) { 2855 - $User.Visitor.NowStep = oSym.NowStep = a; 2856 - $User.Visitor.TimeStep = oSym.TimeStep = c; 2857 - $("dDisplaySpeed").innerHTML = b; 2858 - }), 2859 - (ShowLevel = function () { 3080 + PlayAudio("pause"); 3081 + oSym.Stop(); 3082 + SetBlock($("dSurface")); 3083 + innerText($("dMenu0"), "Speed"); 3084 + ShowOptions(); 3085 + } 3086 + document.getElementById("sOptionsMenu").textContent = "Back To Game"; 3087 + if (ArCard[oS.ChoseCard] && ArCard[oS.ChoseCard].DID != null) { 3088 + CancelPlant(); 3089 + } 3090 + }; 3091 + 3092 + var OptionsMenuDown = function (ele, wrapper) { 3093 + ele.className = "OptionsMenuButtonDown"; 3094 + wrapper.style.paddingTop = "2px"; 3095 + }; 3096 + 3097 + var OptionsMenuUP = function (ele, wrapper) { 3098 + ele.className = "OptionsMenuButton"; 3099 + wrapper.style.paddingTop = "0px"; 3100 + }; 3101 + 3102 + var ShowSpeed = function () { 3103 + oSym.Stop(); 3104 + PlayAudio("gravebutton"); 3105 + SetNone($("dOptionsMenuback"), $("dOptionsMenu")); 3106 + SetBlock($("dSpeedContainer")); 3107 + }; 3108 + 3109 + var HiddenSpeed = function () { 3110 + PlayAudio("tap"); 3111 + SetNone($("dSpeedContainer")); 3112 + if (oS.Lvl) ResetGame($("dMenu0")); 3113 + }; 3114 + 3115 + var CSpeed = function (nowStep, timeStep, displayLabel) { 3116 + $User.Visitor.NowStep = oSym.NowStep = nowStep; 3117 + $User.Visitor.TimeStep = oSym.TimeStep = timeStep; 3118 + $("dDisplaySpeed").innerHTML = displayLabel; 3119 + }; 3120 + 3121 + var ShowLevel = function () { 3122 + PlayAudio("gravebutton"); 3123 + SetNone($("dOptionsMenu")); 3124 + SetBlock($("dAdvSmallContainer")); 3125 + }; 3126 + 3127 + var HiddenLevel = function () { 3128 + PlayAudio("tap"); 3129 + SetNone($("dOptionsMenuback"), $("dAdvSmallContainer")); 3130 + if (oS.Lvl) { 3131 + SetNone($("dSurface")); 3132 + ResetGame($("dMenu0")); 3133 + } 3134 + }; 3135 + 3136 + var ShowMiniGame = function () { 3137 + PlayAudio("gravebutton"); 3138 + SetBlock($("dMiniSmallContainer")); 3139 + }; 3140 + 3141 + var HiddenMiniGame = function (isSilent) { 3142 + if (!isSilent) PlayAudio("tap"); 3143 + SetNone($("dMiniSmallContainer")); 3144 + }; 3145 + 3146 + var ShowRiddleGame = function () { 3147 + PlayAudio("gravebutton"); 3148 + SetBlock($("dRiddleSmallContainer")); 3149 + }; 3150 + 3151 + var HiddenRiddleGame = function (isSilent) { 3152 + if (!isSilent) PlayAudio("tap"); 3153 + SetNone($("dRiddleSmallContainer")); 3154 + }; 3155 + 3156 + var ShowOptions = function () { 3157 + document.getElementById("sOptionsMenu").textContent = "OK"; 3158 + PlayAudio(oS.Lvl ? "gravebutton" : "tap"); 3159 + SetBlock($("dOptionsMenuback"), $("dOptionsMenu")); 3160 + }; 3161 + 3162 + var HiddenOptions = function () { 3163 + PlayAudio("gravebutton"); 3164 + PlayAudio("buttonclick"); 3165 + SetNone($("dOptionsMenuback"), $("dOptionsMenu")); 3166 + if (oS.Lvl) { 3167 + SetNone($("dSurface")); 3168 + ResetGame($("dMenu0")); 3169 + } 3170 + }; 3171 + 3172 + var ViewHandBook = function () { 3173 + SetNone($("dOptionsMenuback"), $("dOptionsMenu")); 3174 + if (oS.Lvl) { 3175 + AllAudioPaused(); 2860 3176 PlayAudio("gravebutton"); 2861 - SetNone($("dOptionsMenu")); 2862 - SetBlock($("dAdvSmallContainer")); 2863 - }), 2864 - (HiddenLevel = function () { 3177 + SetNone($("dSurface")); 3178 + oSym.Stop(); 3179 + innerText($("dMenu0"), "back to game"); 3180 + $("dMenu1").onclick = null; 3181 + } else { 3182 + AllAudioPaused(); 2865 3183 PlayAudio("tap"); 2866 - SetNone($("dOptionsMenuback"), $("dAdvSmallContainer")); 2867 - oS.Lvl && (SetNone($("dSurface")), ResetGame($("dMenu0"))); 2868 - }), 2869 - (ShowMiniGame = function () { 2870 - PlayAudio("gravebutton"); 2871 - SetBlock($("dMiniSmallContainer")); 2872 - }), 2873 - (HiddenMiniGame = function (a) { 2874 - !a && PlayAudio("tap"); 2875 - SetNone($("dMiniSmallContainer")); 2876 - }), 2877 - (ShowRiddleGame = function () { 2878 - PlayAudio("gravebutton"); 2879 - SetBlock($("dRiddleSmallContainer")); 2880 - }), 2881 - (HiddenRiddleGame = function (a) { 2882 - !a && PlayAudio("tap"); 2883 - SetNone($("dRiddleSmallContainer")); 2884 - }), 2885 - (ShowOptions = function () { 2886 - (document.getElementById("sOptionsMenu").textContent = "OK"), PlayAudio(oS.Lvl ? "gravebutton" : "tap"); 2887 - SetBlock($("dOptionsMenuback"), $("dOptionsMenu")); 2888 - }), 2889 - (HiddenOptions = function () { 2890 - PlayAudio("gravebutton"); 2891 - PlayAudio("buttonclick"); 2892 - SetNone($("dOptionsMenuback"), $("dOptionsMenu")); 2893 - oS.Lvl && (SetNone($("dSurface")), ResetGame($("dMenu0"))); 2894 - }), 2895 - (ViewHandBook = function () { 2896 - SetNone($("dOptionsMenuback"), $("dOptionsMenu")); 2897 - oS.Lvl 2898 - ? (AllAudioPaused(), 2899 - PlayAudio("gravebutton"), 2900 - SetNone($("dSurface")), 2901 - oSym.Stop(), 2902 - innerText($("dMenu0"), "back to game"), 2903 - ($("dMenu1").onclick = null)) 2904 - : (AllAudioPaused(), PlayAudio("tap")); 2905 - PlayAudio("ChooseYourSeeds"); 2906 - SetVisible($("dHandBook")); 2907 - }), 2908 - (ReturnHandBookInx = function () { 2909 - PlayAudio("tap"); 2910 - SetNone($("dHandBookP"), $("dHandBookZ")); 2911 - SetHidden($("dHandBookPZ")); 2912 - }), 2913 - (CloseHandBook = function () { 2914 - PlayAudio("tap"); 2915 - StopAudio("ChooseYourSeeds"); 2916 - oS.Lvl ? ResetGame($("dMenu0")) : oSym.addTask(100, AllAudioPauseCanceled); 2917 - SetNone($("dHandBookP"), $("dHandBookZ")); 2918 - SetHidden($("dHandBookPZ"), $("dHandBook")); 2919 - }), 2920 - (ShowHelp = function () { 2921 - PlayAudio("tap"); 2922 - SetBlock($("dHelp")); 2923 - }), 2924 - (HiddenHelp = function () { 2925 - PlayAudio("tap"); 2926 - SetNone($("dHelp")); 2927 - }), 2928 - ($ = function (a) { 2929 - return document.getElementById(a); 2930 - }), 2931 - ($n = function (a) { 2932 - return document.createElement(a); 2933 - }), 2934 - (ClearChild = function () { 2935 - var a = arguments.length; 2936 - var c; 2937 - while (a--) { 2938 - try { 2939 - c = arguments[a]; 2940 - c.parentNode.removeChild(c); 2941 - c = null; 2942 - } catch (b) {} 3184 + } 3185 + PlayAudio("ChooseYourSeeds"); 3186 + SetVisible($("dHandBook")); 3187 + }; 3188 + 3189 + var ReturnHandBookInx = function () { 3190 + PlayAudio("tap"); 3191 + SetNone($("dHandBookP"), $("dHandBookZ")); 3192 + SetHidden($("dHandBookPZ")); 3193 + }; 3194 + 3195 + var CloseHandBook = function () { 3196 + PlayAudio("tap"); 3197 + StopAudio("ChooseYourSeeds"); 3198 + if (oS.Lvl) { 3199 + ResetGame($("dMenu0")); 3200 + } else { 3201 + oSym.addTask(100, AllAudioPauseCanceled); 3202 + } 3203 + SetNone($("dHandBookP"), $("dHandBookZ")); 3204 + SetHidden($("dHandBookPZ"), $("dHandBook")); 3205 + }; 3206 + 3207 + var ShowHelp = function () { 3208 + PlayAudio("tap"); 3209 + SetBlock($("dHelp")); 3210 + }; 3211 + 3212 + var HiddenHelp = function () { 3213 + PlayAudio("tap"); 3214 + SetNone($("dHelp")); 3215 + }; 3216 + 3217 + var $ = function (id) { 3218 + return document.getElementById(id); 3219 + }; 3220 + 3221 + var $n = function (tag) { 3222 + return document.createElement(tag); 3223 + }; 3224 + 3225 + var ClearChild = function () { 3226 + let i = arguments.length; 3227 + while (i--) { 3228 + try { 3229 + let child = arguments[i]; 3230 + child.parentNode.removeChild(child); 3231 + child = null; 3232 + } catch (e) {} 3233 + } 3234 + }; 3235 + 3236 + var SetBlock = function () { 3237 + let i = arguments.length; 3238 + while (i--) { 3239 + if (arguments[i]) arguments[i].style.display = "block"; 3240 + } 3241 + }; 3242 + 3243 + var SetNone = function () { 3244 + let i = arguments.length; 3245 + while (i--) { 3246 + if (arguments[i] && arguments[i].style) { 3247 + arguments[i].style.display = "none"; 3248 + } 3249 + } 3250 + }; 3251 + 3252 + var SetHidden = function () { 3253 + let i = arguments.length; 3254 + while (i--) { 3255 + if (arguments[i]) arguments[i].style.visibility = "hidden"; 3256 + } 3257 + }; 3258 + 3259 + var SetVisible = function () { 3260 + let i = arguments.length; 3261 + while (i--) { 3262 + if (arguments[i]) arguments[i].style.visibility = "visible"; 3263 + } 3264 + }; 3265 + 3266 + var SetAlpha = $User.Browser.IE6 3267 + ? function (ele, val, opacity) { 3268 + ele.style.filter = "alpha(opacity=" + val + ")"; 3269 + } 3270 + : function (ele, val, opacity) { 3271 + ele.style.opacity = opacity; 3272 + }; 3273 + 3274 + var SetStyle = function (ele, styles) { 3275 + const s = ele.style; 3276 + for (let key in styles) { 3277 + s[key] = styles[key]; 3278 + } 3279 + return ele; 3280 + }; 3281 + 3282 + var NewImg = function (id, src, cssText, parent, props) { 3283 + const img = $n("img"); 3284 + img.src = src; 3285 + if (cssText) img.style.cssText = cssText; 3286 + if (props) { 3287 + for (let key in props) { 3288 + img[key] = props[key]; 3289 + } 3290 + } 3291 + if (id) img.id = id; 3292 + if (parent) parent.appendChild(img); 3293 + return img; 3294 + }; 3295 + 3296 + var EditImg = function (img, id, src, styles, parent) { 3297 + if (id) img.id = id; 3298 + if (src) img.src = src; 3299 + if (styles) SetStyle(img, styles); 3300 + if (parent) parent.appendChild(img); 3301 + return img; 3302 + }; 3303 + 3304 + var NewEle = function (id, tag, cssText, props, parent, attrs) { 3305 + const ele = $n(tag); 3306 + if (id) ele.id = id; 3307 + if (cssText) ele.style.cssText = cssText; 3308 + if (props) { 3309 + for (let key in props) { 3310 + ele[key] = props[key]; 3311 + } 3312 + } 3313 + if (attrs) { 3314 + for (let key in attrs) { 3315 + ele.setAttribute(key, attrs[key]); 3316 + } 3317 + } 3318 + if (parent) parent.appendChild(ele); 3319 + return ele; 3320 + }; 3321 + 3322 + var EditEle = function (ele, attrs, styles, props, parent) { 3323 + // Backward/forward compatibility: 3324 + // Many call sites use EditEle(ele, attrs, styles, parent) or 3325 + // EditEle(ele, attrs, styles, parent, props). Detect and normalize. 3326 + if (props && props.nodeType && parent && !parent.nodeType) { 3327 + // (ele, attrs, styles, parentEle, propsObj) 3328 + const realParent = props; 3329 + props = parent; 3330 + parent = realParent; 3331 + } else if (!parent && props && props.nodeType) { 3332 + // (ele, attrs, styles, parentEle) 3333 + parent = props; 3334 + props = null; 3335 + } 3336 + if (attrs) { 3337 + for (let key in attrs) { 3338 + ele.setAttribute(key, attrs[key]); 2943 3339 } 2944 - }), 2945 - (SetBlock = function () { 2946 - var a = arguments.length; 2947 - while (a--) { 2948 - arguments[a].style.display = "block"; 3340 + } 3341 + if (styles) SetStyle(ele, styles); 3342 + if (props) { 3343 + for (let key in props) { 3344 + if (key === "outerText" && !ele.parentNode) { 3345 + ele.textContent = props[key]; 3346 + } else { 3347 + ele[key] = props[key]; 3348 + } 2949 3349 } 2950 - }), 2951 - (SetNone = function () { 2952 - var a = arguments.length; 2953 - while (a--) { 2954 - if (arguments[a] && arguments[a].style) { 2955 - arguments[a].style.display = "none"; 3350 + } 3351 + if (parent) parent.appendChild(ele); 3352 + return ele; 3353 + }; 3354 + 3355 + var NewO = function (proto, constructor) { 3356 + constructor = function () {}; 3357 + constructor.prototype = proto; 3358 + return constructor; 3359 + }; 3360 + 3361 + var SetPrototype = function (child, parent) { 3362 + const p = child.prototype; 3363 + for (let key in parent) { 3364 + p[key] = parent[key]; 3365 + } 3366 + }; 3367 + 3368 + var InheritO = function (Parent, properties, arrayProps, child, parentArr, childArr) { 3369 + const Child = function () {}; 3370 + Child.prototype = new Parent(); 3371 + if (properties) SetPrototype(Child, properties); 3372 + 3373 + if (arrayProps) { 3374 + const proto = Child.prototype; 3375 + for (let key in arrayProps) { 3376 + parentArr = proto[key].slice(0); 3377 + childArr = arrayProps[key]; 3378 + for (let k in childArr) { 3379 + parentArr[k] = childArr[k]; 2956 3380 } 3381 + Child.prototype[key] = parentArr; 2957 3382 } 2958 - }), 2959 - (SetHidden = function () { 2960 - var a = arguments.length; 2961 - while (a--) { 2962 - arguments[a].style.visibility = "hidden"; 3383 + } 3384 + return Child; 3385 + }; 3386 + 3387 + var Compare = function (val, min, max, func, arg) { 3388 + const result = val < min ? min : val > max ? max : val; 3389 + return func ? [func(result), result] : [result]; 3390 + }; 3391 + 3392 + var $Switch = function (val, cases, comparer, result, len) { 3393 + let i = 0; 3394 + len = cases.length; 3395 + while (i < len) { 3396 + if (comparer(val, cases[i])) break; 3397 + ++i; 3398 + } 3399 + return result[i]; 3400 + }; 3401 + 3402 + var $SEql = function (key, map) { 3403 + return key in map ? map[key] : map.default; 3404 + }; 3405 + 3406 + var $SSml = function (val, thresholds, results) { 3407 + let i = 0; 3408 + const len = thresholds.length; 3409 + while (i < len) { 3410 + if (val < thresholds[i]) break; 3411 + ++i; 3412 + } 3413 + return results[i]; 3414 + }; 3415 + 3416 + var $SGrt = function (val, thresholds, results) { 3417 + let i = 0; 3418 + const len = thresholds.length; 3419 + while (i < len) { 3420 + if (val > thresholds[i]) break; 3421 + ++i; 3422 + } 3423 + return results[i]; 3424 + }; 3425 + 3426 + var ImgSpriter = function (id, cardId, config, frameIdx, callback) { 3427 + const frame = config[frameIdx]; 3428 + const nextIdx = frame[2]; 3429 + const ele = $(id); 3430 + 3431 + if (ele) { 3432 + ele.style.backgroundPosition = frame[0]; 3433 + oSym.addTask( 3434 + frame[1], 3435 + (idx) => { 3436 + idx > -1 ? ImgSpriter(id, cardId, config, idx, callback) : callback(id, cardId); 3437 + }, 3438 + [nextIdx] 3439 + ); 3440 + } 3441 + }; 3442 + 3443 + var Ajax = function () {}; 3444 + 3445 + Date.prototype.format = function (fmt) { 3446 + const o = { 3447 + "M+": this.getMonth() + 1, 3448 + "d+": this.getDate(), 3449 + "h+": this.getHours(), 3450 + "m+": this.getMinutes(), 3451 + "s+": this.getSeconds(), 3452 + "q+": Math.floor((this.getMonth() + 3) / 3), 3453 + S: this.getMilliseconds(), 3454 + }; 3455 + if (/(y+)/.test(fmt)) { 3456 + fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); 3457 + } 3458 + for (let k in o) { 3459 + if (new RegExp("(" + k + ")").test(fmt)) { 3460 + fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)); 2963 3461 } 2964 - }), 2965 - (SetVisible = function () { 2966 - var a = arguments.length; 2967 - while (a--) { 2968 - arguments[a].style.visibility = "visible"; 3462 + } 3463 + return fmt; 3464 + }; 3465 + 3466 + var NewMusic = $User.HTML5 3467 + ? function (src) { 3468 + NewAudio({ autoplay: true, loop: true, source: src }); 2969 3469 } 2970 - }), 2971 - (SetAlpha = $User.Browser.IE6 2972 - ? function (c, b, a) { 2973 - c.style.filter = "alpha(opacity=" + b + ")"; 3470 + : function (src) { 3471 + if (!oS.Silence) $("oEmbed").innerHTML = ""; 3472 + }; 3473 + 3474 + var PauseMusic = $User.HTML5 3475 + ? function () { 3476 + const audio = oAudio[oS.LoadMusic]; 3477 + if (audio) { 3478 + audio.currentTime = 0; 3479 + audio.pause(); 2974 3480 } 2975 - : function (c, b, a) { 2976 - c.style.opacity = a; 2977 - }), 2978 - (SetStyle = function (d, b) { 2979 - var c = d.style; 2980 - var a; 2981 - for (a in b) { 2982 - c[a] = b[a]; 3481 + } 3482 + : function () { 3483 + $("oEmbed").innerHTML = ""; 3484 + }; 3485 + 3486 + var StartAdventure = function (level) { 3487 + const handDiv = $("ZombieHand"); 3488 + const advDiv = $("dAdventure"); 3489 + const handImg = NewImg("", "images/interface/ZombieHand.png", "position:absolute;left:0", handDiv); 3490 + 3491 + advDiv.onclick = advDiv.onmouseover = advDiv.onmouseout = null; 3492 + SetBlock(handDiv); 3493 + StopMusic(); 3494 + PlayAudio("losemusic"); 3495 + 3496 + oSym.addTask( 3497 + 120, 3498 + () => { 3499 + PlayAudio("evillaugh"); 3500 + }, 3501 + [] 3502 + ); 3503 + 3504 + oSym.addTask( 3505 + 7, 3506 + function (count, ele, left) { 3507 + ele.style.left = (left -= 330) + "px"; 3508 + if (--count) oSym.addTask(7, arguments.callee, [count, ele, left]); 3509 + }, 3510 + [6, handImg, 0] 3511 + ); 3512 + 3513 + const animation = function (ele, frame, count) { 3514 + if (--count) { 3515 + ele.style.backgroundPosition = ["top", "bottom"][frame]; 3516 + oSym.addTask(10, arguments.callee, [ele, frame ? 0 : 1, count]); 3517 + } else { 3518 + ele.style.backgroundPosition = "top"; 3519 + ele.onclick = StartAdventure; 3520 + ele.onmouseover = function () { 3521 + this.style.backgroundPosition = "bottom"; 3522 + }; 3523 + ele.onmouseout = function () { 3524 + this.style.backgroundPosition = "top"; 3525 + }; 3526 + 3527 + if ($User.HTML5) StopAudio("evillaugh"); 3528 + SelectModal(level); 3529 + handDiv.innerHTML = ""; 2983 3530 } 2984 - return d; 2985 - }), 2986 - (NewImg = function (f, e, b, c, d) { 2987 - var a = $n("img"); 2988 - a.src = e; 2989 - b && (a.style.cssText = b); 2990 - if (d) { 2991 - for (v in d) { 2992 - a[v] = d[v]; 3531 + }; 3532 + 3533 + if ($User.HTML5) { 3534 + animation(advDiv, 1, 50); 3535 + } else { 3536 + NewMusic("evillaugh"); 3537 + animation(advDiv, 1, 50); 3538 + } 3539 + }; 3540 + 3541 + var oAudio = {}; 3542 + var PausedAudioArr = []; 3543 + 3544 + var NewAudio = $User.HTML5 3545 + ? function (config) { 3546 + const src = config.source; 3547 + if (oAudio[src]) return; 3548 + 3549 + const audio = document.createElement("audio"); 3550 + const types = { mp3: "audio/mpeg" }; 3551 + const formats = ["mp3"]; 3552 + let i = formats.length; 3553 + 3554 + audio.autoplay = !!config.autoplay; 3555 + 3556 + if (config.loop) { 3557 + audio.addEventListener( 3558 + "ended", 3559 + () => { 3560 + audio.play(); 3561 + }, 3562 + false 3563 + ); 2993 3564 } 3565 + 3566 + while (i--) { 3567 + let source = document.createElement("source"); 3568 + source.type = types[formats[i]]; 3569 + source.src = "audio/" + src + ".mp3"; 3570 + audio.appendChild(source); 3571 + } 3572 + 3573 + audio.preload = config.preload === undefined ? "auto" : ["auto", "meta", "none"][config.preload]; 3574 + audio.muted = oS.Silence; 3575 + 3576 + if (config.callback) audio.addEventListener("canplaythrough", config.callback, false); 3577 + 3578 + return (oAudio[src] = audio); 2994 3579 } 2995 - f && (a.id = f); 2996 - c && c.appendChild(a); 2997 - return a; 2998 - }), 2999 - (EditImg = function (e, f, c, b, a) { 3000 - f && (e.id = f); 3001 - c && (e.src = c); 3002 - b && SetStyle(e, b); 3003 - a && a.appendChild(e); 3004 - return e; 3005 - }), 3006 - (NewEle = function (h, b, d, a, e, f, g, c) { 3007 - g = $n(b); 3008 - h && (g.id = h); 3009 - d && (g.style.cssText = d); 3010 - if (a) { 3011 - for (c in a) { 3012 - g[c] = a[c]; 3580 + : function () {}; 3581 + 3582 + var PlayMusic = $User.HTML5 3583 + ? function (src) { 3584 + let audio = oAudio[src]; 3585 + if (audio) { 3586 + try { 3587 + audio.currentTime = 0; 3588 + } catch (e) {} 3589 + audio.play(); 3590 + } else { 3591 + NewMusic(src); 3592 + oAudio[src].play(); 3013 3593 } 3014 3594 } 3015 - if (f) { 3016 - for (c in f) { 3017 - g.setAttribute(c, f[c]); 3595 + : function (src) { 3596 + NewMusic(src); 3597 + }; 3598 + 3599 + var PlayAudioLegacy = $User.HTML5 3600 + ? function (src, loop) { 3601 + const audio = oAudio[src]; 3602 + if (audio) { 3603 + audio.loop = !!loop; 3604 + audio.play(); 3605 + } else { 3606 + NewAudio({ source: src, loop: !!loop }).play(); 3018 3607 } 3019 3608 } 3020 - e && e.appendChild(g); 3021 - return g; 3022 - }), 3023 - (EditEle = function (g, f, a, e, b, c) { 3024 - if (f) { 3025 - for (c in f) { 3026 - g.setAttribute(c, f[c]); 3609 + : function () {}; 3610 + 3611 + var PlayAudio = $User.HTML5 3612 + ? function (src, loop) { 3613 + let audio = oAudio[src]; 3614 + if (!audio) { 3615 + audio = NewAudio({ source: src, loop: !!loop }); 3616 + oAudio[src] = audio; 3617 + } else { 3618 + audio.loop = !!loop; 3027 3619 } 3620 + audio.currentTime = 0; 3621 + audio.play(); 3028 3622 } 3029 - a && SetStyle(g, a); 3030 - if (b) { 3031 - for (c in b) { 3032 - g[c] = b[c]; 3033 - } 3623 + : function () {}; 3624 + 3625 + var PauseAudio = $User.HTML5 3626 + ? function (src) { 3627 + oAudio[src].pause(); 3034 3628 } 3035 - e && e.appendChild(g); 3036 - return g; 3037 - }), 3038 - (NewO = function (b, a) { 3039 - return ((a = function () {}).prototype = b), a; 3040 - }), 3041 - (SetPrototype = function (d, c, a) { 3042 - a = d.prototype; 3043 - for (var b in c) { 3044 - a[b] = c[b]; 3629 + : function () {}; 3630 + 3631 + var StopMusic = $User.HTML5 3632 + ? function () { 3633 + const audio = oAudio[oS.LoadMusic]; 3634 + try { 3635 + audio.currentTime = 0; 3636 + } catch (e) {} 3637 + if (audio) audio.pause(); 3045 3638 } 3046 - }), 3047 - (InheritO = function (d, i, c, g, b, h, f, e, a) { 3048 - var g = function () {}; 3049 - g.prototype = new d(); 3050 - i && SetPrototype(g, i); 3051 - if (c) { 3052 - a = g.prototype; 3053 - for (f in c) { 3054 - b = a[f].slice(0); 3055 - h = c[f]; 3056 - for (e in h) { 3057 - b[e] = h[e]; 3639 + : function () {}; 3640 + 3641 + var StopAudio = $User.HTML5 3642 + ? function (src) { 3643 + const audio = oAudio[src]; 3644 + try { 3645 + audio.currentTime = 0; 3646 + } catch (e) {} 3647 + try { 3648 + audio.pause(); 3649 + } catch (e) {} 3650 + } 3651 + : function () {}; 3652 + 3653 + var AllAudioPaused = $User.HTML5 3654 + ? function () { 3655 + for (let key in oAudio) { 3656 + let audio = oAudio[key]; 3657 + if (!(audio.paused || audio.ended)) { 3658 + PausedAudioArr.push(key); 3659 + audio.pause(); 3058 3660 } 3059 - g.prototype[f] = b; 3060 3661 } 3061 3662 } 3062 - return g; 3063 - }), 3064 - (Compare = function (e, b, a, c, d) { 3065 - return (d = e < b ? b : e > a ? a : e), c ? [c(d), d] : [d]; 3066 - }), 3067 - ($Switch = function (h, d, c, a, g, b, e) { 3068 - b = 0; 3069 - g = d.length; 3070 - e = c; 3071 - while (b < g) { 3072 - if (e(h, d[b])) { 3073 - break; 3663 + : function () {}; 3664 + 3665 + var AllAudioPauseCanceled = $User.HTML5 3666 + ? function () { 3667 + let i = PausedAudioArr.length; 3668 + while (i--) { 3669 + oAudio[PausedAudioArr[i]].play(); 3074 3670 } 3075 - ++b; 3076 - } 3077 - return a[b]; 3078 - }), 3079 - ($SEql = function (c, b, a) { 3080 - return c in b ? b[c] : b.default; 3081 - }); 3082 - ($SSml = function (d, c, a) { 3083 - var b = 0; 3084 - LX = c.length; 3085 - while (b < LX) { 3086 - if (d < c[b]) { 3087 - break; 3671 + PausedAudioArr.length = 0; 3088 3672 } 3089 - ++b; 3673 + : function () {}; 3674 + 3675 + var AllAudioMuted = function () { 3676 + for (let key in oAudio) { 3677 + oAudio[key].muted = true; 3678 + } 3679 + }; 3680 + 3681 + var AllAudioMuteCanceled = function () { 3682 + for (let key in oAudio) { 3683 + oAudio[key].muted = false; 3090 3684 } 3091 - return a[b]; 3092 - }), 3093 - ($SGrt = function (d, c, a) { 3094 - var b = 0; 3095 - LX = c.length; 3096 - while (b < LX) { 3097 - if (d > c[b]) { 3098 - break; 3685 + }; 3686 + 3687 + var CheckSilence = $User.HTML5 3688 + ? function (checkbox) { 3689 + const val = checkbox.checked ? 1 : 0; 3690 + if (val !== oS.Silence) { 3691 + addCookie("JSPVZSilence", (oS.Silence = val)); 3692 + val ? AllAudioMuted() : AllAudioMuteCanceled(); 3099 3693 } 3100 - ++b; 3101 3694 } 3102 - return a[b]; 3103 - }), 3104 - (ImgSpriter = function (h, c, e, f, g) { 3105 - var b = e[f]; 3106 - var d = b[2]; 3107 - var a = $(h); 3108 - a && 3109 - ((a.style.backgroundPosition = b[0]), 3110 - oSym.addTask( 3111 - b[1], 3112 - (j) => { 3113 - j > -1 ? ImgSpriter(h, c, e, j, g) : g(h, c); 3114 - }, 3115 - [d] 3116 - )); 3117 - }), 3118 - (Ajax = function () {}), 3119 - (Date.prototype.format = function (b) { 3120 - var c = { 3121 - "M+": this.getMonth() + 1, 3122 - "d+": this.getDate(), 3123 - "h+": this.getHours(), 3124 - "m+": this.getMinutes(), 3125 - "s+": this.getSeconds(), 3126 - "q+": Math.floor((this.getMonth() + 3) / 3), 3127 - S: this.getMilliseconds(), 3695 + : function (checkbox) { 3696 + const val = checkbox.checked ? 1 : 0; 3697 + if (val !== oS.Silence) { 3698 + addCookie("JSPVZSilence", (oS.Silence = val)); 3699 + val ? PauseMusic() : NewMusic(oS.StartGameMusic); 3700 + } 3128 3701 }; 3129 - if (/(y+)/.test(b)) { 3130 - b = b.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); 3131 - } 3132 - for (var a in c) { 3133 - if (new RegExp("(" + a + ")").test(b)) { 3134 - b = b.replace(RegExp.$1, RegExp.$1.length === 1 ? c[a] : ("00" + c[a]).substr(("" + c[a]).length)); 3135 - } 3136 - } 3137 - return b; 3138 - }), 3139 - (NewMusic = $User.HTML5 3140 - ? function (a) { 3141 - NewAudio({ autoplay: true, loop: true, source: a }); 3142 - } 3143 - : function (a) { 3144 - !oS.Silence && ($("oEmbed").innerHTML = ""); 3145 - }), 3146 - (PauseMusic = $User.HTML5 3147 - ? function () { 3148 - var a = oAudio[oS.LoadMusic]; 3149 - a.currentTime = 0; 3150 - a.pause(); 3151 - } 3152 - : function () { 3153 - $("oEmbed").innerHTML = ""; 3154 - }), 3155 - (StartAdventure = function (d) { 3156 - var c = $("ZombieHand"); 3157 - var b = $("dAdventure"); 3158 - var a = NewImg("", "images/interface/ZombieHand.png", "position:absolute;left:0", c); 3159 - b.onclick = b.onmouseover = b.onmouseout = null; 3160 - SetBlock(c); 3161 - StopMusic(); 3162 - PlayAudio("losemusic"); 3702 + 3703 + var AppearCard = function (x, y, PlantClass, moveType, duration) { 3704 + const id = "dCard" + Math.random(); 3705 + let style = `opacity:1;width:100px;height:120px;cursor:url(images/interface/Pointer.cur),pointer;clip:rect(auto,auto,60px,auto);left:${x}px;top:-1000px`; 3706 + duration = duration || 1500; 3707 + let endTop; 3708 + 3709 + if (moveType) { 3710 + endTop = 0; 3711 + oSym.addTask(1, MoveDropCard, [id, y, duration]); 3712 + } else { 3713 + endTop = y - 15 - 20; 3714 + style += ";top:" + endTop + "px"; 3715 + 3716 + oSym.addTask(1, DisappearCard, [id, duration]); 3717 + 3718 + // Parabolic drop animation 3163 3719 oSym.addTask( 3164 - 120, 3165 - () => { 3166 - PlayAudio("evillaugh"); 3167 - }, 3168 - [] 3169 - ); 3170 - oSym.addTask( 3171 - 7, 3172 - function (f, e, g) { 3173 - e.style.left = (g -= 330) + "px"; 3174 - --f && oSym.addTask(7, arguments.callee, [f, e, g]); 3175 - }, 3176 - [6, a, 0] 3177 - ); 3178 - $User.HTML5 3179 - ? (function (g, h, e) { 3180 - var f = oAudio.evillaugh; 3181 - if (--e) { 3182 - g.style.backgroundPosition = ["top", "bottom"][h]; 3183 - oSym.addTask(10, arguments.callee, [g, h ? 0 : 1, e]); 3184 - } else { 3185 - (g.style.backgroundPosition = "top"), (g.onclick = StartAdventure); 3186 - g.onmouseover = function () { 3187 - this.style.backgroundPosition = "bottom"; 3188 - }; 3189 - g.onmouseout = function () { 3190 - this.style.backgroundPosition = "top"; 3191 - }; 3192 - StopAudio("evillaugh"); 3193 - SelectModal(d); 3194 - c.innerHTML = ""; 3195 - } 3196 - })(b, 1, 50) 3197 - : (NewMusic("evillaugh"), 3198 - (function (f, g, e) { 3199 - if (--e) { 3200 - f.style.backgroundPosition = ["top", "bottom"][g]; 3201 - oSym.addTask(10, arguments.callee, [f, g ? 0 : 1, e]); 3202 - } else { 3203 - (f.style.backgroundPosition = "top"), (f.onclick = StartAdventure); 3204 - f.onmouseover = function () { 3205 - this.style.backgroundPosition = "bottom"; 3206 - }; 3207 - f.onmouseout = function () { 3208 - this.style.backgroundPosition = "top"; 3209 - }; 3210 - SelectModal(d); 3211 - c.innerHTML = ""; 3720 + 1, 3721 + function (cardId, curX, curY, xStep, ySteps, dir, stepsLeft, tick) { 3722 + if (ArCard[cardId] && $(cardId)) { 3723 + SetStyle($(cardId), { 3724 + left: (curX += xStep * dir) + "px", 3725 + top: (curY += Number(ySteps[0])) + "px", 3726 + }); 3727 + ySteps.shift(); 3728 + --stepsLeft; 3729 + if (stepsLeft > 0) { 3730 + if (ySteps.length === 0) ySteps = [8, 16, 24, 32]; 3731 + oSym.addTask(tick, arguments.callee, [cardId, curX, curY, xStep, ySteps, dir, stepsLeft, ++tick]); 3212 3732 } 3213 - })(b, 1, 50)); 3214 - }), 3215 - (oAudio = {}), 3216 - (PausedAudioArr = []), 3217 - (NewAudio = $User.HTML5 3218 - ? function (b) { 3219 - var a = b.source; 3220 - if (oAudio[a]) { 3221 - return; 3222 3733 } 3223 - var f = document.createElement("audio"); 3224 - var c = b.autoplay; 3225 - var g = b.loop; 3226 - var m; 3227 - var h = { mp3: "audio/mpeg" }; 3228 - var k = b.preload; 3229 - var l = b.callback; 3230 - var j = ["mp3"]; 3231 - var e = j.length; 3232 - var d; 3233 - f.autoplay = !!c; 3234 - g && 3235 - f.addEventListener( 3236 - "ended", 3237 - () => { 3238 - f.play(); 3239 - }, 3240 - false 3241 - ); 3242 - while (e--) { 3243 - (m = document.createElement("source")).type = h[(d = j[e])]; 3244 - m.src = "audio/" + a + "." + "mp3"; 3245 - f.appendChild(m); 3246 - } 3247 - f.preload = k === undefined ? "auto" : ["auto", "meta", "none"][k]; 3248 - f.muted = oS.Silence; 3249 - l && f.addEventListener("canplaythrough", l, false); 3250 - return (oAudio[a] = f); 3251 - } 3252 - : function () {}), 3253 - (PlayMusic = $User.HTML5 3254 - ? function (b) { 3255 - var a = oAudio[b]; 3256 - if (a) { 3257 - try { 3258 - a.currentTime = 0; 3259 - } catch (c) {} 3260 - a.play(); 3261 - } else { 3262 - NewMusic(b); 3263 - oAudio[b].play(); 3264 - } 3265 - } 3266 - : function (a) { 3267 - NewMusic(a); 3268 - }), 3269 - (PlayAudioLegacy = $User.HTML5 3270 - ? function (c, a) { 3271 - var b = oAudio[c]; 3272 - if (b) { 3273 - b.loop = !!a; 3274 - b.play(); 3275 - } else { 3276 - NewAudio({ source: c, loop: !!a }).play(); 3277 - } 3278 - } 3279 - : function () {}), 3280 - (PlayAudio = $User.HTML5 3281 - ? function (c, a) { 3282 - var b = oAudio[c]; 3734 + }, 3735 + [id, x, endTop, Math.floor(Math.random() * 4), [-32, -24, -16, -8], [-1, 1][Math.floor(Math.random() * 2)], 8, 2] 3736 + ); 3737 + } 3283 3738 3284 - if (!b) { 3285 - b = NewAudio({ source: c, loop: !!a }); 3286 - oAudio[c] = b; 3287 - } else { 3288 - b.loop = !!a; 3289 - } 3739 + ArCard[id] = { 3740 + DID: id, 3741 + PName: PlantClass, 3742 + PixelTop: 600, 3743 + CDReady: 1, 3744 + SunReady: 1, 3745 + top: endTop, 3746 + HasChosen: false, 3747 + Kind: 1, 3748 + }; 3290 3749 3291 - b.currentTime = 0; // Restart to beginning 3292 - b.play(); 3293 - } 3294 - : function () {}), 3295 - (PauseAudio = $User.HTML5 3296 - ? function (a) { 3297 - oAudio[a].pause(); 3298 - } 3299 - : function () {}), 3300 - (StopMusic = $User.HTML5 3301 - ? function () { 3302 - var a = oAudio[oS.LoadMusic]; 3303 - try { 3304 - a.currentTime = 0; 3305 - } catch (b) {} 3306 - a.pause(); 3307 - } 3308 - : function () {}), 3309 - (StopAudio = $User.HTML5 3310 - ? function (b) { 3311 - var a = oAudio[b]; 3312 - try { 3313 - a.currentTime = 0; 3314 - } catch (c) {} 3315 - try { 3316 - a.pause(); 3317 - } catch (c) {} 3318 - } 3319 - : function () {}), 3320 - (AllAudioPaused = $User.HTML5 3321 - ? function () { 3322 - var a; 3323 - var b; 3324 - for (a in oAudio) { 3325 - b = oAudio[a]; 3326 - !(b.paused || b.ended) && (PausedAudioArr.push(a), b.pause()); 3327 - } 3328 - } 3329 - : function () {}), 3330 - (AllAudioPauseCanceled = $User.HTML5 3331 - ? function () { 3332 - var a = PausedAudioArr.length; 3333 - while (a--) { 3334 - oAudio[PausedAudioArr[a]].play(); 3335 - } 3336 - PausedAudioArr.length = 0; 3337 - } 3338 - : function () {}), 3339 - (AllAudioMuted = function () { 3340 - var a; 3341 - for (a in oAudio) { 3342 - oAudio[a].muted = true; 3750 + NewImg(id, PlantClass.prototype.PicArr[PlantClass.prototype.CardGif], style, $("dCardList"), { 3751 + onclick(e) { 3752 + const self = this; 3753 + ClearChild($("MovePlant"), $("MovePlantAlpha")); 3754 + CancelPlant(); 3755 + if (self.style) self.style.opacity = 0.5; 3756 + ChosePlant(e, self.id); 3757 + if (ArCard[self.id]) ArCard[self.id].HasChosen = true; 3758 + }, 3759 + }); 3760 + }; 3761 + 3762 + var MoveDropCard = function (id, targetY, duration) { 3763 + const card = ArCard[id]; 3764 + const ele = $(id); 3765 + if (card && ele) { 3766 + if (!card.HasChosen && card.top < targetY - 52) { 3767 + ele.style.top = (card.top += 2) + "px"; 3768 + oSym.addTask(5, MoveDropCard, [id, targetY, duration]); 3769 + } else { 3770 + DisappearCard(id, duration); 3343 3771 } 3344 - }), 3345 - (AllAudioMuteCanceled = function () { 3346 - var a; 3347 - for (a in oAudio) { 3348 - oAudio[a].muted = false; 3349 - } 3350 - }), 3351 - (CheckSilence = $User.HTML5 3352 - ? function (a) { 3353 - var b = a.checked ? 1 : 0; 3354 - b !== oS.Silence && (addCookie("JSPVZSilence", (oS.Silence = b)), b ? AllAudioMuted() : AllAudioMuteCanceled()); 3355 - } 3356 - : function (a) { 3357 - var b = a.checked ? 1 : 0; 3358 - b !== oS.Silence && (addCookie("JSPVZSilence", (oS.Silence = b)), b ? PauseMusic() : NewMusic(oS.StartGameMusic)); 3359 - }), 3360 - (AppearCard = function (h, f, e, a, t) { 3361 - // x, y, 植物id, 移动卡槽类型, 消失时间(默认 15s) 3362 - var b; 3363 - var d; 3364 - var g = "dCard" + Math.random(); 3365 - var c = "opacity:1;width:100px;height:120px;cursor:url(images/interface/Pointer.cur),pointer;clip:rect(auto,auto,60px,auto);left:" + h + "px;top:-1000"; 3366 - var t = t || 1500; 3772 + } 3773 + }; 3774 + 3775 + var DisappearCard = function (id, duration) { 3776 + const step = 5; 3777 + let ele = $(id); 3778 + 3779 + (function tick(timeLeft) { 3780 + if (!ArCard[id] || !ele) return; 3367 3781 3368 - if (a) { 3369 - (d = 0), oSym.addTask(1, MoveDropCard, [g, f, t]); 3782 + if (oS.Chose === 1 && oS.ChoseCard === id) { 3783 + // Selected, do nothing 3784 + } else if (timeLeft > 500) { 3785 + ele.style.opacity = 1; 3786 + } else if (timeLeft > 0) { 3787 + ele.style.opacity = [1, 0.5][Math.ceil(timeLeft / 50) % 2]; 3788 + } else { 3789 + delete ArCard[id]; 3790 + ClearChild(ele); 3791 + return; 3370 3792 } 3371 - // 从天而降,反之抛物线掉落 3372 - else { 3373 - (d = f - 15 - 20), 3374 - (c += ";top:" + d + "px"), 3375 - oSym.addTask(1, DisappearCard, [g, t]), 3376 - oSym.addTask( 3377 - 1, 3378 - function (q, p, n, j, l, k, m, i) { 3379 - if (ArCard[q] && $(q)) { 3380 - SetStyle($(q), { 3381 - left: (p += j * k) + "px", 3382 - top: (n += Number(l[0])) + "px", 3383 - }); 3384 - l.shift(); 3385 - --m; 3386 - m > 0 && (l.length === 0 && (l = [8, 16, 24, 32]), oSym.addTask(i, arguments.callee, [q, p, n, j, l, k, m, ++i])); 3387 - } 3388 - }, 3389 - [g, h, d, Math.floor(Math.random() * 4), [-32, -24, -16, -8], [-1, 1][Math.floor(Math.random() * 2)], 8, 2] 3390 - ); 3391 - } // 开始记时,确定抛物线,与阳光部分相似故压缩 3392 3793 3393 - ArCard[g] = { 3394 - DID: g, 3395 - PName: e, 3396 - PixelTop: 600, 3397 - CDReady: 1, 3398 - SunReady: 1, 3399 - top: d, 3400 - HasChosen: false, 3401 - Kind: 1, 3402 - }; // 生成卡片数据,是否被点击过 3403 - NewImg(g, e.prototype.PicArr[e.prototype.CardGif], c, $("dCardList"), { 3404 - // 生成卡片 ele 3405 - onclick(g) { 3406 - var self = this; 3407 - var { style } = self; 3408 - var { id } = self; 3409 - ClearChild($("MovePlant"), $("MovePlantAlpha")), 3410 - CancelPlant(), 3411 - style && (style.opacity = 0.5), 3412 - ChosePlant(g, id), 3413 - ArCard[id] && (ArCard[id].HasChosen = true); 3414 - }, 3415 - }); 3416 - }), 3417 - (MoveDropCard = function (c, b, t) { 3418 - // 掉落目标 3419 - var a = ArCard[c]; 3420 - var ele = $(c); 3421 - a && ele && (!a.HasChosen && a.top < b - 52 ? ((ele.style.top = (a.top += 2) + "px"), oSym.addTask(5, MoveDropCard, [c, b, t])) : DisappearCard(c, t)); 3422 - }), 3423 - (DisappearCard = function (d, r) { 3424 - var q = 5; 3425 - var e = $(d); 3426 - var f = function (t) { 3427 - switch (true) { 3428 - case !ArCard[d] || !e: 3429 - return; // 卡片已经消失,不做处理 3430 - case oS.Chose === 1 && oS.ChoseCard === d: 3431 - break; // 选中 3432 - case t > 500: 3433 - e.style.opacity = 1; 3434 - break; // 未到闪烁时间 3435 - case t > 0: 3436 - e.style.opacity = [1, 0.5][Math.ceil(t / 50) % 2]; 3437 - break; // 闪烁 3438 - default: 3439 - delete ArCard[d], ClearChild(e); 3440 - return; 3441 - } 3442 - (e = $(d)), oSym.addTask(q, arguments.callee, [t - q]); 3443 - }; 3444 - f(r); 3445 - }); 3794 + ele = $(id); 3795 + oSym.addTask(step, tick, [timeLeft - step]); 3796 + })(duration); 3797 + }; 3446 3798 3447 3799 NewEle("dTitle", "div", 0, 0, $("dBody")); 3800 + 3801 + const allPlantsStringArray = [ 3802 + // for alamanac 3803 + "oPeashooter", 3804 + "oSunFlower", 3805 + "oCherryBomb", 3806 + "oWallNut", 3807 + "oPotatoMine", 3808 + "oSnowPea", 3809 + "oChomper", 3810 + "oRepeater", 3811 + "oPuffShroom", 3812 + "oSunShroom", 3813 + "oFumeShroom", 3814 + "oGraveBuster", 3815 + "oHypnoShroom", 3816 + "oScaredyShroom", 3817 + "oIceShroom", 3818 + "oDoomShroom", 3819 + "oLilyPad", 3820 + "oSquash", 3821 + "oThreepeater", 3822 + "oTangleKlep", 3823 + "oJalapeno", 3824 + "oSpikeweed", 3825 + "oTorchwood", 3826 + "oTallNut", 3827 + "oCactus", 3828 + "oPlantern", 3829 + "oSplitPea", 3830 + "oStarfruit", 3831 + "oPumpkinHead", 3832 + "oFlowerPot", 3833 + "oCoffeeBean", 3834 + "oGarlic", 3835 + "oSeaShroom", 3836 + "oOxygen", 3837 + "ostar", 3838 + "oTTS", 3839 + "oGun", 3840 + "oSeaAnemone", 3841 + "oGatlingPea", 3842 + "oGloomShroom", 3843 + "oTwinSunflower", 3844 + "oSpikerock", 3845 + "oTenManNut", 3846 + "oSnowRepeater", 3847 + "oCattail", 3848 + "oLotusRoot", 3849 + "oIceFumeShroom", 3850 + "oLaserBean", 3851 + "oBigChomper", 3852 + "oFlamesMushroom", 3853 + "oBalloon", 3854 + ]; 3855 + 3856 + const allPlantsArray = () => { 3857 + // also for almanac 3858 + const arr = []; 3859 + for (let i = 0; i < allPlantsStringArray.length; i++) { 3860 + arr.push(window[allPlantsStringArray[i]]); 3861 + } 3862 + return arr; 3863 + }; 3864 + 3865 + const izombiePlantsMap = [ 3866 + // for izombie (DONT CHANGE THE ORDER!!!!!!) 3867 + "oPeashooter", 3868 + "oSunFlower", 3869 + "oCherryBomb", 3870 + "oWallNut", 3871 + "oPotatoMine", 3872 + "oSnowPea", 3873 + "oChomper", 3874 + "oRepeater", 3875 + "oPuffShroom", 3876 + "oSunShroom", 3877 + "oFumeShroom", 3878 + "oGraveBuster", 3879 + "oHypnoShroom", 3880 + "oScaredyShroom", 3881 + "oIceShroom", 3882 + "oDoomShroom", 3883 + "oLilyPad", 3884 + "oILilyPad", 3885 + "oSquash", 3886 + "oThreepeater", 3887 + "oTangleKlep", 3888 + "oJalapeno", 3889 + "oSpikeweed", 3890 + "oTorchwood", 3891 + "oTallNut", 3892 + "oCactus", 3893 + "oPlantern", 3894 + "oSplitPea", 3895 + "oStarfruit", 3896 + "oPumpkinHead", 3897 + "oFlowerPot", 3898 + "oCoffeeBean", 3899 + "oGarlic", 3900 + "oSeaShroom", 3901 + "oOxygen", 3902 + "ostar", 3903 + "oTTS", 3904 + "oGun", 3905 + "oSeaAnemone", 3906 + "oGatlingPea", 3907 + "oGloomShroom", 3908 + "oTwinSunflower", 3909 + "oSpikerock", 3910 + "oTenManNut", 3911 + "oSnowRepeater", 3912 + "oCattail", 3913 + "oLotusRoot", 3914 + "oIceFumeShroom", 3915 + "oLaserBean", 3916 + "oBigChomper", 3917 + "oFlamesMushroom", 3918 + ];
+28 -1
game/js/Custom.js
··· 200 200 }, 100); 201 201 } 202 202 203 - checkInterval2; 203 + checkInterval2(); 204 204 205 205 let playingSounds = []; 206 206 function PlaySound2(path, name, loop = false) { ··· 231 231 } 232 232 }); 233 233 } 234 + 235 + // new save system 236 + 237 + $User.Visitor.SaveLvl = 1; 238 + $User.Visitor.SaveLvlCallBack = function (o) { 239 + /* 240 + o is an object with these properties: 241 + - Lvl: level name (number for adventure mode, text for others) 242 + - SunNum: remaining sun after completing the level 243 + - UserName: player's name 244 + - T: time taken to complete the level (divide by 100 to get seconds) 245 + */ 246 + // check if o.Lvl is valid and is in the whitelist 247 + if (!o.Lvl || !saveWhitelist.includes(o.Lvl)) { 248 + return; 249 + } 250 + // save logic 251 + let levels = {}; 252 + // check if "levels" exists in localStorage 253 + if (localStorage.getItem("levels")) { 254 + levels = JSON.parse(localStorage.getItem("levels")); 255 + } 256 + // add the level to the levels object if it doesn't exist 257 + if (!levels[o.Lvl]) { 258 + levels[o.Lvl] = o; 259 + } 260 + };
+5
game/js/Init.js
··· 1 + $User.Client.PC && $User.HTTP 2 + ? ((oS.AutoSun = Math.floor(getCookie("JSPVZAutoSun"))) && ($("cAutoSun").checked = true), 3 + (oS.Silence = Math.floor(getCookie("JSPVZSilence"))) && ($("cSilence").checked = true)) 4 + : ((oS.AutoSun = 1), ($("cAutoSun").checked = true), (oS.Silence = 0), ($("cSilence").checked = false)); 5 + InitGame();
+352
game/js/WebComponents.js
··· 1 + class TextButton extends HTMLInputElement { 2 + constructor() { 3 + super(); 4 + this.type = "button"; 5 + this.id = "btnNextLevel"; 6 + // reset some of its css 7 + this.style.position = "initial"; 8 + this.style.width = "auto"; 9 + this.style.height = "auto"; 10 + this.style.left = "initial"; 11 + this.style.top = "initial"; 12 + } 13 + set text(value) { 14 + this.value = value; 15 + } 16 + get text() { 17 + return this.value; 18 + } 19 + } 20 + 21 + class AlmanacButtonPlant extends HTMLInputElement { 22 + constructor() { 23 + super(); 24 + this.type = "button"; 25 + this.id = "btnViewPlant"; 26 + // reset margin-top 27 + this.style.marginTop = "initial"; 28 + } 29 + set text(value) { 30 + this.value = value; 31 + } 32 + get text() { 33 + return this.value; 34 + } 35 + } 36 + 37 + class AlmanacButtonZombie extends HTMLInputElement { 38 + constructor() { 39 + super(); 40 + this.type = "button"; 41 + this.id = "btnViewZombie"; 42 + // reset margin-top 43 + this.style.marginTop = "initial"; 44 + } 45 + set text(value) { 46 + this.value = value; 47 + } 48 + get text() { 49 + return this.value; 50 + } 51 + } 52 + 53 + class AlmanacButton extends HTMLDivElement { 54 + constructor() { 55 + super(); 56 + this.className = "handbook"; 57 + // reset some of its css 58 + this.style.position = "initial"; 59 + this.style.left = "initial"; 60 + this.style.top = "initial"; 61 + this.onmouseover = function () { 62 + this.style.backgroundPosition = "bottom"; 63 + }; 64 + this.onmouseout = function () { 65 + this.style.backgroundPosition = "top"; 66 + }; 67 + this.onclick = function () { 68 + ViewHandBook(); 69 + }; 70 + this.style.backgroundPosition = "center top"; 71 + } 72 + } 73 + 74 + class MinigameButton extends HTMLElement { 75 + constructor() { 76 + super(); 77 + const shadow = this.attachShadow({ mode: "open" }); 78 + 79 + const container = document.createElement("div"); 80 + container.style.cursor = "url(images/interface/Pointer.cur), pointer"; 81 + container.style.width = "150px"; 82 + container.style.height = "139px"; 83 + container.style.background = "url(images/interface/Challenge.png) no-repeat 50%"; 84 + container.style.fontSize = "12px"; 85 + container.style.textAlign = "center"; 86 + container.style.display = "flex"; 87 + container.style.flexDirection = "column"; 88 + 89 + const imageContainer = document.createElement("div"); 90 + imageContainer.style.paddingTop = "18px"; 91 + 92 + const imageSlot = document.createElement("slot"); 93 + imageSlot.name = "image"; 94 + 95 + const defaultImg = document.createElement("img"); 96 + defaultImg.src = "images/interface/izombie.png"; 97 + imageSlot.appendChild(defaultImg); 98 + 99 + imageContainer.appendChild(imageSlot); 100 + container.appendChild(imageContainer); 101 + 102 + const textContainer = document.createElement("div"); 103 + textContainer.className = "list"; 104 + textContainer.style.flex = "1"; 105 + textContainer.style.display = "flex"; 106 + textContainer.style.alignItems = "center"; 107 + textContainer.style.justifyContent = "center"; 108 + 109 + const textSlot = document.createElement("slot"); 110 + textSlot.name = "text"; 111 + textSlot.textContent = "I, Zombie"; 112 + 113 + textContainer.appendChild(textSlot); 114 + container.appendChild(textContainer); 115 + 116 + const spacer = document.createElement("div"); 117 + spacer.style.height = "14px"; 118 + container.appendChild(spacer); 119 + 120 + shadow.appendChild(container); 121 + } 122 + } 123 + 124 + class TextBox extends HTMLElement { 125 + constructor() { 126 + super(); 127 + const shadow = this.attachShadow({ mode: "open" }); 128 + 129 + const container = document.createElement("div"); 130 + container.style.position = "relative"; 131 + container.style.display = "inline-block"; 132 + 133 + const textArea = document.createElement("input"); 134 + textArea.type = "text"; 135 + textArea.style.padding = "7px"; 136 + textArea.style.paddingRight = "45px"; 137 + textArea.style.borderStyle = "solid"; 138 + textArea.style.borderRadius = "10px"; 139 + textArea.style.fontSize = "large"; 140 + textArea.style.fontFamily = "briannetod"; 141 + textArea.placeholder = this.getAttribute("placeholder") || ""; 142 + container.appendChild(textArea); 143 + 144 + this.container = container; 145 + this.textArea = textArea; 146 + shadow.appendChild(container); 147 + } 148 + 149 + connectedCallback() { 150 + // Optional icon button 151 + if (this.hasAttribute("show-button")) { 152 + const buttonType = this.getAttribute("show-button"); 153 + const button = document.createElement("button"); 154 + button.style.position = "absolute"; 155 + button.style.right = "0"; 156 + button.style.top = "50%"; 157 + button.style.transform = "translateY(-50%)"; 158 + button.style.width = "35px"; 159 + button.style.height = "34px"; 160 + button.style.cursor = 'url("images/interface/Pointer.cur"), pointer'; 161 + button.style.backgroundColor = "rgb(255, 255, 255)"; 162 + button.style.borderStyle = "hidden"; 163 + button.style.borderRadius = "0px 10px 10px 0px"; 164 + button.style.display = "flex"; 165 + button.style.alignItems = "center"; 166 + button.style.justifyContent = "center"; 167 + 168 + if (buttonType === "copy") { 169 + button.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M0 0h24v24H0z" stroke="none"></path><path d="M7 9.667A2.667 2.667 0 0 1 9.667 7h8.666A2.667 2.667 0 0 1 21 9.667v8.666A2.667 2.667 0 0 1 18.333 21H9.667A2.667 2.667 0 0 1 7 18.333z"></path><path d="M4.012 16.737A2 2 0 0 1 3 15V5c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1"></path></svg>`; 170 + button.addEventListener("click", () => { 171 + navigator.clipboard.writeText(this.textArea.value); 172 + this.dispatchEvent( 173 + new CustomEvent("button-click", { 174 + detail: { value: this.textArea.value, action: "copy" }, 175 + }) 176 + ); 177 + }); 178 + } else if (buttonType === "clear") { 179 + button.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>`; 180 + button.addEventListener("click", () => { 181 + this.textArea.value = ""; 182 + this.dispatchEvent(new CustomEvent("button-click", { detail: { value: "", action: "clear" } })); 183 + }); 184 + } 185 + 186 + this.container.appendChild(button); 187 + } 188 + } 189 + 190 + static get observedAttributes() { 191 + return ["placeholder"]; 192 + } 193 + 194 + attributeChangedCallback(name, oldValue, newValue) { 195 + if (name === "placeholder") { 196 + const input = this.shadowRoot.querySelector("input"); 197 + if (input) { 198 + input.placeholder = newValue; 199 + } 200 + } 201 + } 202 + } 203 + 204 + class ScrollingFrame extends HTMLDivElement { 205 + constructor() { 206 + super(); 207 + this.style.position = "relative"; 208 + 209 + // Add custom scrollbar styles 210 + const style = document.createElement("style"); 211 + style.textContent = ` 212 + .custom-scrollbar { 213 + overflow-y: scroll !important; 214 + overflow-x: hidden !important; 215 + } 216 + 217 + .custom-scrollbar-xy { 218 + overflow: scroll !important; 219 + } 220 + 221 + .custom-scrollbar::-webkit-scrollbar, 222 + .custom-scrollbar-xy::-webkit-scrollbar { 223 + width: 12px; 224 + height: 12px; 225 + } 226 + 227 + .custom-scrollbar::-webkit-scrollbar-thumb, 228 + .custom-scrollbar-xy::-webkit-scrollbar-thumb { 229 + background: #954f19; 230 + border-radius: 10px; 231 + box-shadow: inset -1px -1px 2px 0 rgba(0, 0, 0, 0.2), 232 + inset 1px 1px 2px 0 #b6703b; 233 + background: linear-gradient(133deg, #954f19, #904b17); 234 + } 235 + 236 + .custom-scrollbar::-webkit-scrollbar-track, 237 + .custom-scrollbar-xy::-webkit-scrollbar-track { 238 + border-radius: 10px; 239 + box-shadow: inset -0.5px -0.5px 2px 0 rgba(255, 255, 255, 0.5), 240 + inset 0.5px 0.5px 2px 0 rgba(0, 0, 0, 0.2); 241 + background: linear-gradient(133deg, #e4a865, #d29a59); 242 + } 243 + `; 244 + 245 + if (!document.getElementById("scrolling-frame-styles")) { 246 + style.id = "scrolling-frame-styles"; 247 + document.head.appendChild(style); 248 + } 249 + } 250 + 251 + connectedCallback() { 252 + if (this.hasAttribute("scroll-x")) { 253 + this.style.setProperty("overflow", "scroll", "important"); 254 + this.classList.add("custom-scrollbar-xy"); 255 + } else { 256 + this.style.setProperty("overflow-y", "scroll", "important"); 257 + this.style.setProperty("overflow-x", "hidden", "important"); 258 + this.classList.add("custom-scrollbar"); 259 + } 260 + } 261 + } 262 + 263 + class RockButton extends HTMLDivElement { 264 + constructor() { 265 + super(); 266 + this.classList.add("BigLevel"); 267 + this.classList.add("button"); 268 + // reset some css 269 + this.style.width = "170px"; 270 + this.style.marginLeft = "initial"; 271 + this.style.textAlign = "center"; 272 + // disable text selection 273 + this.style.userSelect = "none"; 274 + } 275 + } 276 + 277 + class MenuButton extends HTMLDivElement { 278 + constructor() { 279 + super(); 280 + this.id = "bMainMenu"; 281 + // reset some css 282 + this.style.visibility = "visible"; 283 + this.style.position = "initial"; 284 + this.style.left = "initial"; 285 + this.style.top = "initial"; 286 + this.onmouseover = function () { 287 + this.style.backgroundPosition = "bottom"; 288 + }; 289 + this.onmouseout = function () { 290 + this.style.backgroundPosition = "top"; 291 + }; 292 + } 293 + } 294 + 295 + class MenuButtonX extends MenuButton { 296 + constructor() { 297 + super(); 298 + this.id = "dRiddleClose"; 299 + } 300 + } 301 + 302 + class ScrollingFrameStoneScrollBar extends ScrollingFrame { 303 + constructor() { 304 + super(); 305 + 306 + // Add stone scrollbar styles 307 + const style = document.createElement("style"); 308 + style.textContent = ` 309 + .stone-scrollbar::-webkit-scrollbar { 310 + width: 12px; 311 + height: 12px; 312 + } 313 + 314 + .stone-scrollbar::-webkit-scrollbar-thumb { 315 + border-radius: 3px; 316 + box-shadow: inset -1px -1px 2px 0 rgba(0, 0, 0, 0.2), 317 + inset 1px 1px 2px 0 rgba(255, 255, 255, 0.5); 318 + background: linear-gradient(130deg, #5f606f, #525362); 319 + } 320 + 321 + .stone-scrollbar::-webkit-scrollbar-track { 322 + border-radius: 3px; 323 + box-shadow: inset -0.5px -0.5px 2px 0 rgba(255, 255, 255, 0.5), 324 + inset 0.5px 0.5px 2px 0 rgba(0, 0, 0, 0.2); 325 + background: linear-gradient(133deg, #ded5f7, #c9c1e2); 326 + } 327 + `; 328 + 329 + if (!document.getElementById("stone-scrollbar-styles")) { 330 + style.id = "stone-scrollbar-styles"; 331 + document.head.appendChild(style); 332 + } 333 + 334 + // Remove parent class and add stone class 335 + this.classList.remove("custom-scrollbar", "custom-scrollbar-xy"); 336 + this.classList.add("stone-scrollbar"); 337 + } 338 + } 339 + 340 + customElements.define("text-button", TextButton, { extends: "input" }); 341 + customElements.define("almanac-button-plant", AlmanacButtonPlant, { extends: "input" }); 342 + customElements.define("almanac-button-zombie", AlmanacButtonZombie, { extends: "input" }); 343 + customElements.define("almanac-button", AlmanacButton, { extends: "div" }); 344 + customElements.define("minigame-button", MinigameButton); 345 + customElements.define("text-box", TextBox); 346 + customElements.define("scrolling-frame", ScrollingFrame, { extends: "div" }); 347 + customElements.define("rock-button", RockButton, { extends: "div" }); 348 + customElements.define("menu-button", MenuButton, { extends: "div" }); 349 + customElements.define("menu-button-x", MenuButtonX, { extends: "div" }); 350 + customElements.define("scrolling-frame-stone-scroll-bar", ScrollingFrameStoneScrollBar, { 351 + extends: "div", 352 + });
+2
game/js/msgpack.min.js
··· 1 + !function(){"use strict";function e(r,s){if(s&&s.multiple&&!Array.isArray(r))throw new Error("Invalid argument type: Expected an Array to serialize multiple values.");const d=4294967296;let y,h,n=new Uint8Array(128),i=0;if(s&&s.multiple)for(let e=0;e<r.length;e++)g(r[e]);else g(r);return n.subarray(0,i);function g(r,e){switch(typeof r){case"undefined":w();break;case"boolean":v(r?195:194);break;case"number":t=r,isFinite(t)&&Number.isSafeInteger(t)?0<=t&&t<=127||t<0&&-32<=t?v(t):0<t&&t<=255?m([204,t]):-128<=t&&t<=127?m([208,t]):0<t&&t<=65535?m([205,t>>>8,t]):-32768<=t&&t<=32767?m([209,t>>>8,t]):0<t&&t<=4294967295?m([206,t>>>24,t>>>16,t>>>8,t]):-2147483648<=t&&t<=2147483647?m([210,t>>>24,t>>>16,t>>>8,t]):0<t&&t<=0x10000000000000000?(v(207),b(t)):-0x8000000000000000<=t&&t<=0x8000000000000000?(v(211),b(t)):m(t<0?[211,128,0,0,0,0,0,0,0]:[207,255,255,255,255,255,255,255,255]):(h||(y=new ArrayBuffer(8),h=new DataView(y)),h.setFloat64(0,t),v(203),m(new Uint8Array(y)));break;case"string":var t=r,n=(t=function(t){let r=!0,n=t.length;for(let e=0;e<n;e++)if(127<t.charCodeAt(e)){r=!1;break}let i=0,a=new Uint8Array(t.length*(r?1:4));for(let r=0;r!==n;r++){let e=t.charCodeAt(r);if(e<128)a[i++]=e;else{if(e<2048)a[i++]=e>>6|192;else{if(55295<e&&e<56320){if(++r>=n)throw new Error("UTF-8 encode: incomplete surrogate pair");var o=t.charCodeAt(r);if(o<56320||57343<o)throw new Error("UTF-8 encode: second surrogate character 0x"+o.toString(16)+" at index "+r+" out of range");e=65536+((1023&e)<<10)+(1023&o),a[i++]=e>>18|240,a[i++]=e>>12&63|128}else a[i++]=e>>12|224;a[i++]=e>>6&63|128}a[i++]=63&e|128}}return r?a:a.subarray(0,i)}(r)).length;n<=31?v(160+n):m(n<=255?[217,n]:n<=65535?[218,n>>>8,n]:[219,n>>>24,n>>>16,n>>>8,n]),m(t);break;case"object":if(null===r)w();else if(r instanceof Date){n=r;var i=n.getTime()/1e3;{var a;0===n.getMilliseconds()&&0<=i&&i<4294967296?m([214,255,i>>>24,i>>>16,i>>>8,i]):0<=i&&i<17179869184?m([215,255,(a=1e6*n.getMilliseconds())>>>22,a>>>14,a>>>6,a<<2>>>0|i/d,i>>>24,i>>>16,i>>>8,i]):(m([199,12,255,(a=1e6*n.getMilliseconds())>>>24,a>>>16,a>>>8,a]),b(i))}}else if(Array.isArray(r))p(r);else if(r instanceof Uint8Array||r instanceof Uint8ClampedArray){i=r;var o=i.length;m(o<=255?[196,o]:o<=65535?[197,o>>>8,o]:[198,o>>>24,o>>>16,o>>>8,o]);m(i)}else if(r instanceof Int8Array||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)p(r);else{var f,l,u=r;let e=0;for(f in u)void 0!==u[f]&&e++;for(l in e<=15?v(128+e):e<=65535?m([222,e>>>8,e]):m([223,e>>>24,e>>>16,e>>>8,e]),u){var c=u[l];void 0!==c&&(g(l),g(c))}}break;default:if(e||!s||!s.invalidTypeReplacement)throw new Error("Invalid argument type: The type '"+typeof r+"' cannot be serialized.");"function"==typeof s.invalidTypeReplacement?g(s.invalidTypeReplacement(r),!0):g(s.invalidTypeReplacement,!0)}var t}function w(){v(192)}function p(r){var t=r.length;t<=15?v(144+t):m(t<=65535?[220,t>>>8,t]:[221,t>>>24,t>>>16,t>>>8,t]);for(let e=0;e<t;e++)g(r[e])}function v(e){if(n.length<i+1){let e=2*n.length;for(;e<i+1;)e*=2;var r=new Uint8Array(e);r.set(n),n=r}n[i]=e,i++}function m(r){if(n.length<i+r.length){let e=2*n.length;for(;e<i+r.length;)e*=2;var t=new Uint8Array(e);t.set(n),n=t}n.set(r,i),i+=r.length}function b(e){let r,t;t=0<=e?(r=e/d,e%d):(e++,r=Math.abs(e)/d,t=Math.abs(e)%d,r=~r,~t),m([r>>>24,r>>>16,r>>>8,r,t>>>24,t>>>16,t>>>8,t])}}function r(o,e){const i=4294967296;let f=0;if("object"!=typeof(o=o instanceof ArrayBuffer?new Uint8Array(o):o)||void 0===o.length)throw new Error("Invalid argument type: Expected a byte array (Array or Uint8Array) to deserialize.");if(!o.length)throw new Error("Invalid argument: The byte array to deserialize is empty.");o instanceof Uint8Array||(o=new Uint8Array(o));let r;if(e&&e.multiple)for(r=[];f<o.length;)r.push(n());else r=n();return r;function n(){var e=o[f++];if(0<=e&&e<=127)return e;if(128<=e&&e<=143)return c(e-128);if(144<=e&&e<=159)return s(e-144);if(160<=e&&e<=191)return d(e-160);if(192===e)return null;if(193===e)throw new Error("Invalid byte code 0xc1 found.");if(194===e)return!1;if(195===e)return!0;if(196===e)return u(-1,1);if(197===e)return u(-1,2);if(198===e)return u(-1,4);if(199===e)return y(-1,1);if(200===e)return y(-1,2);if(201===e)return y(-1,4);if(202===e)return t(4);if(203===e)return t(8);if(204===e)return l(1);if(205===e)return l(2);if(206===e)return l(4);if(207===e)return l(8);if(208===e)return a(1);if(209===e)return a(2);if(210===e)return a(4);if(211===e)return a(8);if(212===e)return y(1);if(213===e)return y(2);if(214===e)return y(4);if(215===e)return y(8);if(216===e)return y(16);if(217===e)return d(-1,1);if(218===e)return d(-1,2);if(219===e)return d(-1,4);if(220===e)return s(-1,2);if(221===e)return s(-1,4);if(222===e)return c(-1,2);if(223===e)return c(-1,4);if(224<=e&&e<=255)return e-256;throw console.debug("msgpack array:",o),new Error("Invalid byte value '"+e+"' at index "+(f-1)+" in the MessagePack binary data (length "+o.length+"): Expecting a range of 0 to 255. This is not a byte array.")}function a(e){let r=0,t=!0;for(;0<e--;){var n;t?(n=o[f++],r+=127&n,128&n&&(r-=128),t=!1):r=(r*=256)+o[f++]}return r}function l(e){let r=0;for(;0<e--;)r=(r*=256)+o[f++];return r}function t(e){var r=new DataView(o.buffer,f+o.byteOffset,e);return f+=e,4===e?r.getFloat32(0,!1):8===e?r.getFloat64(0,!1):void 0}function u(e,r){e<0&&(e=l(r));r=o.subarray(f,f+e);return f+=e,r}function c(e,r){e<0&&(e=l(r));for(var t={};0<e--;)t[n()]=n();return t}function s(e,r){e<0&&(e=l(r));for(var t=[];0<e--;)t.push(n());return t}function d(e,n){e<0&&(e=l(n));n=f;f+=e;{var i=o,a=e;let r=n,t="";for(a+=n;r<a;){let e=i[r++];if(127<e)if(191<e&&e<224){if(r>=a)throw new Error("UTF-8 decode: incomplete 2-byte sequence");e=(31&e)<<6|63&i[r++]}else if(223<e&&e<240){if(r+1>=a)throw new Error("UTF-8 decode: incomplete 3-byte sequence");e=(15&e)<<12|(63&i[r++])<<6|63&i[r++]}else{if(!(239<e&&e<248))throw new Error("UTF-8 decode: unknown multibyte start 0x"+e.toString(16)+" at index "+(r-1));if(r+2>=a)throw new Error("UTF-8 decode: incomplete 4-byte sequence");e=(7&e)<<18|(63&i[r++])<<12|(63&i[r++])<<6|63&i[r++]}if(e<=65535)t+=String.fromCharCode(e);else{if(!(e<=1114111))throw new Error("UTF-8 decode: code point 0x"+e.toString(16)+" exceeds UTF-16 reach");e-=65536,t=(t+=String.fromCharCode(e>>10|55296))+String.fromCharCode(1023&e|56320)}}return t}}function y(e,r){e<0&&(e=l(r));var t,r=l(1),e=u(e);if(255!==r)return{type:r,data:e};if(4===(r=e).length)return t=(r[0]<<24>>>0)+(r[1]<<16>>>0)+(r[2]<<8>>>0)+r[3],new Date(1e3*t);if(8===r.length)return t=(r[0]<<22>>>0)+(r[1]<<14>>>0)+(r[2]<<6>>>0)+(r[3]>>>2),n=(3&r[3])*i+(r[4]<<24>>>0)+(r[5]<<16>>>0)+(r[6]<<8>>>0)+r[7],new Date(1e3*n+t/1e6);if(12!==r.length)throw new Error("Invalid data length for a date value.");var n=(r[0]<<24>>>0)+(r[1]<<16>>>0)+(r[2]<<8>>>0)+r[3],r=(f-=8,a(8));return new Date(1e3*r+n/1e6)}}var t={serialize:e,deserialize:r,encode:e,decode:r};"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=t:window[window.msgpackJsName||"msgpack"]=t}(); 2 + //# sourceMappingURL=msgpack.min.js.map
-25
game/level/0.js
··· 143 143 }); 144 144 $("ZombieHand").style.display = "none"; 145 145 StopAudio("jackinthebox"); 146 - startInterval2(); 147 - function runIzlCheck() { 148 - // check if the izl query parameter is set 149 - let izl = new URLSearchParams(window.location.search).get("izl"); 150 - if (izl && izl !== "") { 151 - try { 152 - izl[0] === "=" ? (levelDataToLoad = parseCloneTiny(decodeURIComponent(icl))) : (levelDataToLoad = parseClone(decodeURIComponent(izl))); 153 - } catch (e) { 154 - alert("Failed to load level data from query parameter"); 155 - // regex away all query params and reload 156 - window.location.search = ""; 157 - // push to history so that the user can go back 158 - window.history.pushState({}, document.title, window.location.pathname); 159 - document.location.reload(); 160 - return; 161 - } 162 - // load the izombiecustomlevel level 163 - if (levelDataToLoad.lfValue[3] === 2) { 164 - SelectModal("izombiecustomlevelwater"); 165 - } else { 166 - SelectModal("izombiecustomlevelnormal"); 167 - } 168 - } 169 - } 170 - runIzlCheck();
+15 -15
game/level/CardRain.js
··· 75 75 oP.FlagNum === oP.FlagZombies && oP.SetTimeoutWaterZombie(5, 9, 4, [oDuckyTubeZombie1, oDuckyTubeZombie2, oDuckyTubeZombie3]); 76 76 }, 77 77 StartGame() { 78 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 79 - SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")), SetHidden($("dSunNum")); // 隐藏阳光和卡槽 78 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 79 + (SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")), SetHidden($("dSunNum"))); // 隐藏阳光和卡槽 80 80 81 81 (function () { 82 82 // 隐藏原卡槽 ··· 86 86 } 87 87 })(); 88 88 89 - oS.InitLawnMower(), 89 + (oS.InitLawnMower(), 90 90 PrepareGrowPlants(() => { 91 91 oP.Monitor(oS.Monitor, oS.UserDefinedFlagFunc); 92 92 oSym.addTask( 93 93 1500, 94 94 () => { 95 - oP.AddZombiesFlag(), SetVisible($("dFlagMeterContent")); 95 + (oP.AddZombiesFlag(), SetVisible($("dFlagMeterContent"))); 96 96 }, 97 97 [] 98 98 ); ··· 100 100 var a = dRand(GetX(0), GetX(oS.C)); 101 101 var b = dRand(GetY(1), GetY(oS.R - 1)); 102 102 var d = oS.PName[dRand(1, oS.PName.length) - 1]; 103 - AppearCard(a, b, d, 1, 1000), oSym.addTask(dRand(500, 900), arguments.callee, []); 103 + (AppearCard(a, b, d, 1, 1000), oSym.addTask(dRand(500, 900), arguments.callee, [])); 104 104 })(); 105 - }); 105 + })); 106 106 }, 107 107 }, 108 108 { ··· 135 135 FlagToEnd() { 136 136 NewImg("imgSF", "images/interface/trophy.png", "left:43.5%;top:220px", EDAll, { 137 137 onclick() { 138 - SelectModal(0), PlayAudio("winmusic"); 138 + (SelectModal(0), PlayAudio("winmusic")); 139 139 }, 140 140 }); 141 141 NewImg("PointerUD", "images/interface/PointerDown.gif", "top:185px;left:51%", EDAll); ··· 155 155 var t = t || 1500; 156 156 157 157 if (a) { 158 - (d = 0), oSym.addTask(1, MoveDropCard, [g, f, t]); 158 + ((d = 0), oSym.addTask(1, MoveDropCard, [g, f, t])); 159 159 } 160 160 // 从天而降,反之抛物线掉落 161 161 else { 162 - (d = f - 15 - 20), 162 + ((d = f - 15 - 20), 163 163 (c += ";top:" + d + "px"), 164 164 oSym.addTask(1, DisappearCard, [g, t]), 165 165 oSym.addTask( ··· 176 176 } 177 177 }, 178 178 [g, h, d, Math.floor(Math.random() * 4), [-32, -24, -16, -8], [-1, 1][Math.floor(Math.random() * 2)], 8, 2] 179 - ); 179 + )); 180 180 } // 开始记时,确定抛物线,与阳光部分相似故压缩 181 181 182 182 ArCard[g] = { ··· 195 195 var self = this; 196 196 var { style } = self; 197 197 var { id } = self; 198 - ClearChild($("MovePlant"), $("MovePlantAlpha")), 198 + (ClearChild($("MovePlant"), $("MovePlantAlpha")), 199 199 CancelPlant(), 200 200 style && (style.opacity = 0.5), 201 201 ChosePlant(g, id), 202 - ArCard[id] && (ArCard[id].HasChosen = true); 202 + ArCard[id] && (ArCard[id].HasChosen = true)); 203 203 }, 204 204 }); 205 205 }, ··· 227 227 e.style.opacity = [1, 0.5][Math.ceil(t / 50) % 2]; 228 228 break; // 闪烁 229 229 default: 230 - delete ArCard[d], ClearChild(e); 230 + (delete ArCard[d], ClearChild(e)); 231 231 return; 232 232 } 233 - (e = $(d)), oSym.addTask(q, arguments.callee, [t - q]); 233 + ((e = $(d)), oSym.addTask(q, arguments.callee, [t - q])); 234 234 }; 235 235 f(r); 236 236 }, ··· 251 251 : asyncInnerHTML( 252 252 (a = new h()).CustomBirth(e, b, 0, "auto"), 253 253 (n, m) => { 254 - EDPZ.appendChild(n), m.Birth(); 254 + (EDPZ.appendChild(n), m.Birth()); 255 255 }, 256 256 a 257 257 ),
+13 -13
game/level/FlowerDefense.js
··· 81 81 oS.ChangeBG($("Black_box"), $("BackGround_TF_night"), 1, () => { 82 82 AppearTombstones(4, 9, 8); 83 83 oP.SetTimeoutTomZombie([oZombie, oConeheadZombie]); 84 - (oS.DKind = 0), (oS.AddSunNum = 1); 84 + ((oS.DKind = 0), (oS.AddSunNum = 1)); 85 85 }); 86 86 } 87 87 if (oP.FlagZombies === 41) { 88 88 oS.ChangeBG($("White_box"), $("BackGround_Unsodded"), 1, () => { 89 - ($("BackGround_TF_night").style.opacity = 0), (oS.AddSunNum = 5); 89 + (($("BackGround_TF_night").style.opacity = 0), (oS.AddSunNum = 5)); 90 90 dag.clear(); 91 91 oS.DKind = 1; 92 92 for (let i in oGd.$Crater) { ··· 130 130 }, 131 131 rewrite() { 132 132 oP.MonPrgs = function () { 133 - innerText(ESSunNum, (oS.SunNum = Math.min(oS.SunNum + oS.AddSunNum, 9990))), MonitorCard(); 133 + (innerText(ESSunNum, (oS.SunNum = Math.min(oS.SunNum + oS.AddSunNum, 9990))), MonitorCard()); 134 134 var u = oP; 135 135 var j; 136 136 var i = u.FlagZombies; ··· 303 303 redag: [], 304 304 init_dag() { 305 305 dag.add_edge = (u, v) => { 306 - (u = JSON.stringify(u) || u.toString()), (v = JSON.stringify(v) || v.toString()); 306 + ((u = JSON.stringify(u) || u.toString()), (v = JSON.stringify(v) || v.toString())); 307 307 if (Array.isArray(dag[u])) { 308 308 dag[u].push(v); 309 309 } else { ··· 350 350 let finaly = (ty - tp) * yS; 351 351 let finalx = (tx - x) * xS; 352 352 if (finaly > 0) { 353 - (b.Reduce[0] = 0), (b.Ele.style.top = ty - b.height + b.GetDY() + "px"), (b.RSpeed = 0); 353 + ((b.Reduce[0] = 0), (b.Ele.style.top = ty - b.height + b.GetDY() + "px"), (b.RSpeed = 0)); 354 354 } 355 355 if (finalx > 0) { 356 - (b.Reduce[1] = 0), (b.AttackedLX -= b.X), (b.AttackedRX -= b.X); 357 - (b.X = tx - point - b.beAttackedPointL), (b.AttackedLX += b.X), (b.AttackedRX += b.X); 358 - (b.Ele.style.left = b.X + "px"), (b.Speed = 0); 356 + ((b.Reduce[1] = 0), (b.AttackedLX -= b.X), (b.AttackedRX -= b.X)); 357 + ((b.X = tx - point - b.beAttackedPointL), (b.AttackedLX += b.X), (b.AttackedRX += b.X)); 358 + ((b.Ele.style.left = b.X + "px"), (b.Speed = 0)); 359 359 } 360 360 if (b.Reduce[0] === b.Reduce[1] && b.Reduce[0] === 0) { 361 361 delete b.Next_Edge; ··· 372 372 ar: [l], 373 373 CustomTop: tp, 374 374 }); 375 - (b.ZX -= r), (b.AttackedLX -= r), (b.AttackedRX -= r), (b.X -= r); 375 + ((b.ZX -= r), (b.AttackedLX -= r), (b.AttackedRX -= r), (b.X -= r)); 376 376 b.Ele.style.left = b.X + "px"; 377 377 } 378 378 }, ··· 408 408 } 409 409 } 410 410 if (!to) { 411 - (b.RSpeed = 0), (b.Speed = b.Speed2); 411 + ((b.RSpeed = 0), (b.Speed = b.Speed2)); 412 412 continue; 413 413 } 414 414 let toArr = JSON.parse(to); 415 415 let Reduce = (b.Reduce = b.Reduce || [nowArr[0] - toArr[0], nowArr[1] - toArr[1]]); 416 416 b.Speed = b.Speed2 * Reduce[1] * (!!b.FreeSlowTime * 0.5 || 1) * !b.FreeFreezeTime; 417 417 b.RSpeed = b.Speed2 * Reduce[0] * (!!b.FreeSlowTime * 0.5 || 1) * !b.FreeFreezeTime; 418 - (Eletop = Number(b.Ele.style.top.split("px")[0]) - b.RSpeed), (b.Ele.style.top = Eletop + "px"); 418 + ((Eletop = Number(b.Ele.style.top.split("px")[0]) - b.RSpeed), (b.Ele.style.top = Eletop + "px")); 419 419 ctk_arrive_grid(b, toArr, Reduce, Eletop, b.ZX + point); 420 420 ctk_change_r(b, Eletop); 421 421 ctk_final_set(b); ··· 448 448 var d; 449 449 while (e--) { 450 450 (m = document.createElement("source")).type = j[e]; 451 - (m.src = a), f.appendChild(m); 451 + ((m.src = a), f.appendChild(m)); 452 452 } 453 - (f.autoplay = !!c), (f.preload = k === undefined ? "auto" : ["auto", "meta", "none"][k]), (f.muted = oS.Silence); 453 + ((f.autoplay = !!c), (f.preload = k === undefined ? "auto" : ["auto", "meta", "none"][k]), (f.muted = oS.Silence)); 454 454 g && 455 455 f.addEventListener( 456 456 "ended",
+36
game/level/debug.js
··· 1 + oS.Init( 2 + { 3 + PName: [oLawnCleaner, oCleaner, oPoolCleaner, oBrains, oGoldenPrize, oShovel, oFlowerVase, oIZombie], 4 + ZName: [oZombie, oZombie2, oZombie3, oConeheadZombie, oPoleVaultingZombie], 5 + PicArr: (function () { 6 + var a = oSnowPea.prototype; 7 + var b = a.PicArr; 8 + return ["images/interface/background1.jpg", "images/interface/crater1.png", b[a.CardGif], b[a.NormalGif]]; 9 + })(), 10 + backgroundImage: "images/interface/background1.jpg", 11 + CanSelectCard: 0, 12 + LevelName: "Level 1-6", 13 + LvlEName: 6, 14 + LargeWaveFlag: { 9: $("imgFlag1") }, 15 + }, 16 + { 17 + AZ: [ 18 + [oZombie, 3, 1], 19 + [oZombie2, 2, 1], 20 + [oZombie3, 2, 1], 21 + [oConeheadZombie, 2, 1], 22 + [oPoleVaultingZombie, 1, 1], 23 + ], 24 + FlagNum: 9, 25 + FlagToSumNum: { a1: [3, 5, 8], a2: [1, 2, 3, 9] }, 26 + FlagToMonitor: { 8: [ShowFinalWave, 0] }, 27 + FlagToEnd() { 28 + NewImg("imgSF", "images/Card/Plants/SnowPea.png", "left:827px;top:525px;clip:rect(auto,auto,60px,auto)", EDAll, { 29 + onclick() { 30 + GetNewCard(this, oSnowPea, 7); 31 + }, 32 + }); 33 + NewImg("PointerUD", "images/interface/PointerDown.gif", "top:490px;left:836px", EDAll); 34 + }, 35 + } 36 + );
+88
game/level/debug_izombie.js
··· 1 + let coolerPeashooter = oPeashooter; 2 + // dirty fix for preloading peashooter as a zombie 3 + coolerPeashooter.prototype.Init = function () { 4 + // do nothing lol 5 + }; 6 + // dirty fix to make it plantable 7 + coolerPeashooter.prototype.CustomBirth = function (c, d, b, a) { 8 + // do a customspecial instead 9 + let ele = CustomSpecial(oPeashooter, c, d).plantImage; 10 + ele.classList.add("cardboard"); 11 + }; 12 + oS.Init({ 13 + PName: [oPeashooter, oSunFlower, oSnowPea, oSquash], 14 + ZName: [oIZombie, oIBucketheadZombie, oIFootballZombie, coolerPeashooter], 15 + PicArr: ["images/interface/background2.jpg", "images/interface/trophy.png", "images/interface/Stripe.png"], 16 + backgroundImage: "images/interface/background2.jpg", 17 + ShowScroll: false, 18 + SunNum: 150, 19 + BrainsNum: 5, 20 + ProduceSun: false, 21 + CardKind: 1, 22 + DKind: 0, 23 + LevelName: "I, Zombie", 24 + StartGameMusic: "Cerebrawl", 25 + InitLawnMower() { 26 + var a = 6; 27 + while (--a) { 28 + CustomSpecial(oBrains, a, -1); 29 + } 30 + }, 31 + ArP: { 32 + ArC: [1, 4], 33 + ArR: [1, 5], 34 + Auto: 1, 35 + P: [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3], 36 + }, 37 + RiddleAutoGrow() { 38 + var k = oS.ArP; 39 + var f = k.ArC; 40 + var j = k.ArR; 41 + var e = k.P; 42 + var d = oS.PName; 43 + var c; 44 + var g = f[0]; 45 + var b = f[1]; 46 + var i = j[0]; 47 + var h = j[1]; 48 + var a; 49 + if (k.Auto) { 50 + while (i <= h) { 51 + CustomSpecial(oBrains, i, 0); 52 + for (a = g; a <= b; a++) { 53 + let placed = CustomSpecial(d[e[(c = Math.floor(Math.random() * e.length))]], i, a); 54 + console.log(placed); 55 + placed.plantImage.classList.add("cardboard"); 56 + e.splice(c, 1); 57 + } 58 + ++i; 59 + } 60 + } 61 + NewImg("iStripe", "images/interface/Stripe.png", "left:" + (GetX1X2(5)[0] - 11) + "px;top:65px", EDAll); 62 + }, 63 + StartGame() { 64 + SetVisible($("dSunNum")); 65 + SetBlock($("dTop")); 66 + oP.Monitor({ 67 + ar: [0], 68 + f(d) { 69 + var b = oS.Chose; 70 + var a = arguments.callee; 71 + switch (d) { 72 + case 0: 73 + BeginCool(); 74 + (function () { 75 + SetVisible($("dFlagMeter"), $("dFlagMeterContent")); 76 + ClearChild($("oEmbed")); 77 + StopMusic(); 78 + PlayMusic((oS.LoadMusic = "Cerebrawl")); 79 + BeginCool(); 80 + oP.Monitor(); 81 + })(); 82 + } 83 + }, 84 + }); 85 + SetVisible($("dFlagMeter")); 86 + oS.RiddleAutoGrow(); 87 + }, 88 + });
+2 -2
game/level/izombie10.js
··· 49 49 while (Point.length && Arr.length) { 50 50 let placed = CustomSpecial(oS.PName[Arr.at(-1)], Point.at(-1)[1], Point.at(-1)[0], 1); 51 51 placed.plantImage.classList.add("cardboard"); 52 - Point.length--, Arr.length--; 52 + (Point.length--, Arr.length--); 53 53 } 54 54 }, 55 55 RiddleAutoGrow() { ··· 95 95 NewImg("iStripe", "images/interface/Stripe.png", "left:" + (GetX1X2(6)[0] - 11) + "px;top:65px", EDAll); 96 96 }, 97 97 StartGame() { 98 - oP.Monitor(), BeginCool(); 98 + (oP.Monitor(), BeginCool()); 99 99 SetVisible($("dFlagMeter"), $("dFlagMeterContent"), $("dTop")); 100 100 oS.RiddleAutoGrow(); 101 101 },
+47 -48
game/level/izombiecustomlevelnormal.js
··· 21 21 levelDataToLoad = { 22 22 lfValue: [0, 1, 1, 1, 1, 1], 23 23 music: "Cerebrawl", 24 - name: "lol", 24 + name: "Error", 25 25 plants: [ 26 26 { 27 - zIndex: 6, 28 - plantRow: 2, 29 27 plantCol: 1, 30 28 plantName: "oWallNut", 29 + plantRow: 2, 30 + zIndex: 6, 31 31 }, 32 32 { 33 - zIndex: 9, 34 - plantRow: 3, 35 33 plantCol: 1, 36 34 plantName: "oWallNut", 35 + plantRow: 3, 36 + zIndex: 9, 37 37 }, 38 38 { 39 - zIndex: 12, 39 + plantCol: 1, 40 + plantName: "oWallNut", 40 41 plantRow: 4, 42 + zIndex: 12, 43 + }, 44 + { 41 45 plantCol: 1, 42 46 plantName: "oWallNut", 47 + plantRow: 1, 48 + zIndex: 3, 43 49 }, 44 50 { 45 - zIndex: 12, 46 - plantRow: 4, 47 51 plantCol: 2, 48 52 plantName: "oWallNut", 53 + plantRow: 1, 54 + zIndex: 3, 49 55 }, 50 56 { 51 - zIndex: 6, 52 - plantRow: 2, 53 - plantCol: 4, 57 + plantCol: 2, 54 58 plantName: "oWallNut", 59 + plantRow: 3, 60 + zIndex: 9, 55 61 }, 56 62 { 57 - zIndex: 9, 58 - plantRow: 3, 59 - plantCol: 4, 63 + plantCol: 1, 60 64 plantName: "oWallNut", 65 + plantRow: 5, 66 + zIndex: 15, 61 67 }, 62 68 { 63 - zIndex: 12, 64 - plantRow: 4, 69 + plantCol: 2, 70 + plantName: "oWallNut", 71 + plantRow: 5, 72 + zIndex: 15, 73 + }, 74 + { 65 75 plantCol: 4, 66 76 plantName: "oWallNut", 77 + plantRow: 5, 78 + zIndex: 15, 67 79 }, 68 80 { 69 - zIndex: 6, 70 - plantRow: 2, 71 - plantCol: 5, 81 + plantCol: 4, 72 82 plantName: "oWallNut", 83 + plantRow: 4, 84 + zIndex: 12, 73 85 }, 74 86 { 75 - zIndex: 12, 76 - plantRow: 4, 77 87 plantCol: 5, 78 88 plantName: "oWallNut", 89 + plantRow: 3, 90 + zIndex: 9, 79 91 }, 80 92 { 81 - zIndex: 6, 82 - plantRow: 2, 83 - plantCol: 6, 93 + plantCol: 4, 84 94 plantName: "oWallNut", 95 + plantRow: 3, 96 + zIndex: 9, 85 97 }, 86 98 { 87 - zIndex: 9, 88 - plantRow: 3, 89 - plantCol: 6, 99 + plantCol: 7, 90 100 plantName: "oWallNut", 101 + plantRow: 5, 102 + zIndex: 15, 91 103 }, 92 104 { 93 - zIndex: 12, 94 - plantRow: 4, 95 - plantCol: 6, 105 + plantCol: 7, 96 106 plantName: "oWallNut", 97 - }, 98 - { 107 + plantRow: 4, 99 108 zIndex: 12, 100 - plantRow: 4, 101 - plantCol: 8, 102 - plantName: "oWallNut", 103 109 }, 104 110 { 105 - zIndex: 12, 106 - plantRow: 4, 107 - plantCol: 9, 111 + plantCol: 7, 108 112 plantName: "oWallNut", 109 - }, 110 - { 113 + plantRow: 3, 111 114 zIndex: 9, 112 - plantRow: 3, 113 - plantCol: 8, 114 - plantName: "oWallNut", 115 115 }, 116 116 { 117 - zIndex: 6, 118 - plantRow: 2, 119 117 plantCol: 8, 120 118 plantName: "oWallNut", 119 + plantRow: 3, 120 + zIndex: 9, 121 121 }, 122 122 ], 123 - screenshot: "", 124 - stripeCol: 49, 125 - sun: 49, 123 + stripeCol: 9, 124 + sun: 0, 126 125 }; 127 126 } 128 127 // make sure the keys are the right types
+71 -84
game/level/izombiecustomlevelwater.js
··· 21 21 levelDataToLoad = { 22 22 lfValue: [0, 1, 1, 2, 2, 1, 1], 23 23 music: "Cerebrawl", 24 - name: "lol", 24 + name: "Error", 25 25 plants: [ 26 26 { 27 - zIndex: 6, 28 - plantRow: 2, 27 + plantCol: 2, 28 + plantName: "oWallNut", 29 + plantRow: 1, 30 + zIndex: 3, 31 + }, 32 + { 29 33 plantCol: 1, 30 34 plantName: "oWallNut", 35 + plantRow: 1, 36 + zIndex: 3, 31 37 }, 32 38 { 33 - zIndex: 9, 34 - plantRow: 3, 35 39 plantCol: 1, 36 40 plantName: "oLilyPad", 41 + plantRow: 3, 42 + zIndex: 9, 37 43 }, 38 44 { 39 - zIndex: 12, 40 - plantRow: 4, 41 45 plantCol: 1, 42 46 plantName: "oLilyPad", 47 + plantRow: 4, 48 + zIndex: 12, 43 49 }, 44 50 { 45 - zIndex: 9, 46 - plantRow: 3, 47 51 plantCol: 1, 48 52 plantName: "oWallNut", 53 + plantRow: 2, 54 + zIndex: 6, 49 55 }, 50 56 { 51 - zIndex: 12, 52 - plantRow: 4, 53 57 plantCol: 1, 54 58 plantName: "oWallNut", 59 + plantRow: 3, 60 + zIndex: 9, 55 61 }, 56 62 { 57 - zIndex: 12, 58 - plantRow: 4, 59 63 plantCol: 2, 60 64 plantName: "oLilyPad", 65 + plantRow: 3, 66 + zIndex: 9, 61 67 }, 62 68 { 63 - zIndex: 12, 64 - plantRow: 4, 65 69 plantCol: 2, 66 70 plantName: "oWallNut", 71 + plantRow: 3, 72 + zIndex: 9, 67 73 }, 68 74 { 69 - zIndex: 6, 70 - plantRow: 2, 71 - plantCol: 4, 75 + plantCol: 1, 72 76 plantName: "oWallNut", 77 + plantRow: 4, 78 + zIndex: 12, 73 79 }, 74 80 { 75 - zIndex: 6, 76 - plantRow: 2, 77 - plantCol: 5, 81 + plantCol: 1, 78 82 plantName: "oWallNut", 83 + plantRow: 5, 84 + zIndex: 15, 79 85 }, 80 86 { 81 - zIndex: 6, 82 - plantRow: 2, 83 - plantCol: 6, 87 + plantCol: 2, 84 88 plantName: "oWallNut", 89 + plantRow: 5, 90 + zIndex: 15, 85 91 }, 86 92 { 87 - zIndex: 9, 88 - plantRow: 3, 89 93 plantCol: 4, 90 - plantName: "oLilyPad", 94 + plantName: "oWallNut", 95 + plantRow: 5, 96 + zIndex: 15, 91 97 }, 92 98 { 93 - zIndex: 12, 94 - plantRow: 4, 95 99 plantCol: 4, 96 100 plantName: "oLilyPad", 97 - }, 98 - { 99 - zIndex: 12, 100 101 plantRow: 4, 101 - plantCol: 6, 102 - plantName: "oLilyPad", 102 + zIndex: 12, 103 103 }, 104 104 { 105 - zIndex: 12, 106 - plantRow: 4, 107 - plantCol: 5, 105 + plantCol: 4, 108 106 plantName: "oLilyPad", 109 - }, 110 - { 107 + plantRow: 3, 111 108 zIndex: 9, 112 - plantRow: 3, 113 - plantCol: 6, 114 - plantName: "oLilyPad", 115 109 }, 116 110 { 117 - zIndex: 9, 118 - plantRow: 3, 119 111 plantCol: 4, 120 112 plantName: "oWallNut", 113 + plantRow: 4, 114 + zIndex: 12, 121 115 }, 122 116 { 123 - zIndex: 12, 124 - plantRow: 4, 125 117 plantCol: 4, 126 118 plantName: "oWallNut", 119 + plantRow: 3, 120 + zIndex: 9, 127 121 }, 128 122 { 129 - zIndex: 12, 130 - plantRow: 4, 131 123 plantCol: 5, 132 - plantName: "oWallNut", 124 + plantName: "oLilyPad", 125 + plantRow: 3, 126 + zIndex: 9, 133 127 }, 134 128 { 135 - zIndex: 12, 136 - plantRow: 4, 137 - plantCol: 6, 129 + plantCol: 5, 138 130 plantName: "oWallNut", 139 - }, 140 - { 131 + plantRow: 3, 141 132 zIndex: 9, 142 - plantRow: 3, 143 - plantCol: 6, 144 - plantName: "oWallNut", 145 133 }, 146 134 { 147 - zIndex: 6, 148 - plantRow: 2, 149 - plantCol: 8, 135 + plantCol: 7, 150 136 plantName: "oWallNut", 137 + plantRow: 5, 138 + zIndex: 15, 151 139 }, 152 140 { 153 - zIndex: 12, 141 + plantCol: 7, 142 + plantName: "oLilyPad", 154 143 plantRow: 4, 155 - plantCol: 8, 156 - plantName: "oLilyPad", 144 + zIndex: 12, 157 145 }, 158 146 { 159 - zIndex: 12, 160 - plantRow: 4, 161 - plantCol: 9, 147 + plantCol: 7, 162 148 plantName: "oLilyPad", 149 + plantRow: 3, 150 + zIndex: 9, 163 151 }, 164 152 { 165 - zIndex: 9, 166 - plantRow: 3, 167 153 plantCol: 8, 168 154 plantName: "oLilyPad", 155 + plantRow: 3, 156 + zIndex: 9, 169 157 }, 170 158 { 171 - zIndex: 9, 172 - plantRow: 3, 173 - plantCol: 8, 159 + plantCol: 7, 174 160 plantName: "oWallNut", 161 + plantRow: 4, 162 + zIndex: 12, 175 163 }, 176 164 { 177 - zIndex: 12, 178 - plantRow: 4, 179 - plantCol: 8, 165 + plantCol: 7, 180 166 plantName: "oWallNut", 167 + plantRow: 3, 168 + zIndex: 9, 181 169 }, 182 170 { 183 - zIndex: 12, 184 - plantRow: 4, 185 - plantCol: 9, 171 + plantCol: 8, 186 172 plantName: "oWallNut", 173 + plantRow: 3, 174 + zIndex: 9, 187 175 }, 188 176 ], 189 - screenshot: "", 190 - stripeCol: 49, 191 - sun: 49, 177 + stripeCol: 9, 178 + sun: 0, 192 179 }; 193 180 } 194 181 // make sure the keys are the right types ··· 285 272 }; 286 273 /*for (var i = f[0]; i <= f[1]; ++i) 287 274 CustomSpecial(oILilyPad, 3, i), CustomSpecial(oLilyPad, 4, i); // 荷叶*/ 288 - SummonRange(Arr, 3, 4), oS.RandomGrow(Arr, e.Arr); // 处理泳池的植物 289 - SummonRange(Arr, 1, 2), SummonRange(Arr, 5, 6), oS.RandomGrow(Arr, e.Arr1), oS.RandomGrow(Arr, e.Arr); // 处理剩余的植物 290 - SummonRange(Arr, 1, 6), oS.RandomGrow(Arr, e.Arr2); // 处理南瓜头 275 + (SummonRange(Arr, 3, 4), oS.RandomGrow(Arr, e.Arr)); // 处理泳池的植物 276 + (SummonRange(Arr, 1, 2), SummonRange(Arr, 5, 6), oS.RandomGrow(Arr, e.Arr1), oS.RandomGrow(Arr, e.Arr)); // 处理剩余的植物 277 + (SummonRange(Arr, 1, 6), oS.RandomGrow(Arr, e.Arr2)); // 处理南瓜头 291 278 for (var i = j[0]; i <= j[1]; ++i) { 292 279 CustomSpecial(oBrains, i, 0); 293 280 } // 脑子 ··· 297 284 restoreToPlants(levelDataToLoad); // load the plants 298 285 // clear all query parameters from the url without reloadng 299 286 window.history.pushState({}, document.title, window.location.pathname); 300 - oP.Monitor(), BeginCool(); 287 + (oP.Monitor(), BeginCool()); 301 288 SetVisible($("dFlagMeter"), $("dFlagMeterContent"), $("dTop")); 302 289 oS.RiddleAutoGrow(); 303 290 },
+3 -3
game/level/izombiecustommenu.js
··· 17 17 LoadAccess(a) { 18 18 NewImg("imgSF", "images/interface/BackButton.png", "left:785px;top:530px", EDAll, { 19 19 onclick() { 20 - SelectModal(0); 21 - SetBlock($("dSurface"), $("iSurfaceBackground")); 20 + PlayAudio("tap"); 21 + LoadMenu("izombieonline", "images/interface/IZombie_Background.png"); 22 22 }, 23 23 }); 24 24 // native code from now on ··· 61 61 inputDataElement.value = "Loading..."; 62 62 // decode the input value 63 63 try { 64 - levelDataToLoad = levelData[0] === "=" ? parseCloneTiny(levelData) : parseClone(levelData); 64 + levelDataToLoad = levelData[0] === "=" ? parseCloneTiny_OLD(levelData) : parseCloneTiny(levelData); 65 65 } catch (e) { 66 66 inputDataElement.value = "Invalid level data!"; 67 67 inputDataElement.disabled = false;
+413 -17
game/level/izombieleveleditor.js
··· 7 7 */ 8 8 var IZMode = oS.NowLevel ?? "ChoseMode"; // 读取当前关卡模式 9 9 var Change_Level = function (ModeName) { 10 - (oS.NowLevel = ModeName), SelectModal(oS.Lvl), (oS.NowLevel = ModeName); 10 + ((oS.NowLevel = ModeName), SelectModal(oS.Lvl), (oS.NowLevel = ModeName)); 11 11 }; // 以特定模式重新载入本关 12 12 var $FJ = function (a, b) { 13 13 // 覆盖数组 ··· 86 86 $("tGround").style.left = 0; 87 87 ClearChild($("dButton1"), $("dButton2")); 88 88 (function () { 89 - (EDAll.scrollLeft += 25) < 500 ? oSym.addTask(2, arguments.callee, []) : SetVisible($("dMenu"), $("dSelectCard"), $("dCardList")); 89 + (EDAll.scrollLeft += 25) < 500 90 + ? oSym.addTask(2, arguments.callee, []) 91 + : (() => { 92 + SetVisible($("dMenu"), $("dSelectCard"), $("dCardList")); 93 + if (typeof levelDataToLoad !== "undefined") { 94 + // get a list of what plants are used 95 + let plantsUsed = []; 96 + for (let i = 0; i < levelDataToLoad.plants.length; i++) { 97 + let plantName = levelDataToLoad.plants[i].plantName; 98 + if (!plantsUsed.includes(plantName)) { 99 + plantsUsed.push(plantName); 100 + } 101 + } 102 + // select the plants 103 + for (let i = 0; i < plantsUsed.length; i++) { 104 + SelectCard(plantsUsed[i]); 105 + } 106 + } 107 + })(); 90 108 })(); 91 109 }; 92 110 a(0); ··· 95 113 oP.Monitor({ 96 114 ar: [], 97 115 f() { 116 + if (typeof levelDataToLoad !== "undefined") { 117 + restoreToPlants(levelDataToLoad); 118 + } 98 119 var a = NewEle("DivTeach", "div", "line-height:40px;font-size:14px;top:380px", 0, EDAll); // 选择阵型列数 99 120 var b = function (c) { 100 - ClearChild($("DivTeach")), ImmediatelyCool(); // 取消冻结全部植物 121 + (ClearChild($("DivTeach")), ImmediatelyCool()); // 取消冻结全部植物 101 122 SetVisible($("tdShovel"), $("dFlagMeter")); // 显示铲子 102 123 NewImg("iStripe", "images/interface/Stripe.png", "left:" + (GetX1X2(c)[0] - 11) + "px;top:65px", EDAll); // 生成线 103 124 NewEle( ··· 169 190 170 191 for (k in g) { 171 192 if (Object.hasOwn(g, k)) { 172 - (z = (i = k.split("_"))[0] + i[1] + $SEql(g[k].EName, j)), (m = z + m), (r = Math.max(r, i[1])); 193 + ((z = (i = k.split("_"))[0] + i[1] + $SEql(g[k].EName, j)), (m = z + m), (r = Math.max(r, i[1]))); 173 194 } 174 195 } // 生成植物数据,采用倒叙生成 175 196 ··· 196 217 if (l.length === 0) { 197 218 l = "My I, Zombie Level"; 198 219 } 199 - ($("btnClickSave").innerHTML = "Saving.."), ($("btnClickSave").disabled = "disabled"); // 按钮样式 220 + (($("btnClickSave").innerHTML = "Saving.."), ($("btnClickSave").disabled = "disabled")); // 按钮样式 200 221 // ajax("asp/ImZombieCreateGame.asp", "post", "mapkind=" + oS.MapKind + "&SNum=" + f + "&T=" + escape(l) + "&C=" + escape(m), function(c){eval(c)}); // 发送请求 201 222 $("btnClickSave").innerHTML = "Saved!"; 202 223 let levelDataElement = document.createElement("input"); ··· 279 300 uploadButton.id = "btnNextLevel"; // not actually a next level button, but it's the same style 280 301 uploadButton.style.top = "60%"; 281 302 uploadButton.style.left = "calc(50% - 56.5px)"; 282 - uploadButton.style.display = "none"; 283 303 uploadButton.onclick = function () { 284 304 closeButton.style.display = "none"; 285 305 uploadButton.style.display = "none"; ··· 288 308 copyButtonElement.style.display = "none"; 289 309 titleElement.innerText = "Saving..."; 290 310 const author = prompt("Author name:"); 291 - const newLevelData = compressStringAsBytes(tinyifyClone(cloneFromPlants(l, f, true))); 311 + const newLevelData = stringifyCloneTinyAsBytes(cloneFromPlants(l, f, true)); 292 312 titleElement.innerText = "Configuring..."; 293 313 let serverConfig; 294 - fetch("http://localhost:3000/api/config") 314 + fetch(`${$User.Server.URL}/api/config`, { 315 + headers: { 316 + Accept: "application/msgpack", 317 + }, 318 + }) 295 319 .then((response) => { 296 320 if (!response.ok) { 297 321 throw new Error("Failed to get server configuration"); 298 322 } 299 - return response.json(); 323 + return response.arrayBuffer(); 300 324 }) 301 325 .then((config) => { 302 - serverConfig = config; 326 + serverConfig = msgpack.deserialize(config); 303 327 let turnstileToken; 304 328 let container; 305 329 if (serverConfig.turnstileEnabled) { ··· 312 336 container.id = "turnstile-container"; 313 337 314 338 window.turnstile.render(container, { 315 - sitekey: config.turnstileSiteKey, 339 + sitekey: serverConfig.turnstileSiteKey, 316 340 callback(token) { 317 341 turnstileToken = token; 318 342 }, ··· 352 376 } 353 377 354 378 // upload level data as octet-stream 355 - fetch(`http://localhost:3000/api/levels?${queryParams.toString()}`, { 379 + fetch(`${$User.Server.URL}/api/levels?${queryParams.toString()}`, { 356 380 method: "POST", 357 381 headers: { 358 382 "Content-Type": "application/octet-stream", ··· 418 442 downloadButton.style.top = "60%"; 419 443 downloadButton.style.left = "calc(66.666% - 56.5px)"; // "calc(50% + 5px)"; 420 444 downloadButton.onclick = function () { 421 - downloadBytesAsFile(compressStringAsBytes(tinyifyClone(cloneFromPlants(l, f))), l + ".izl2"); 445 + downloadBytesAsFile(stringifyCloneTinyAsBytes(cloneFromPlants(l, f)), l + ".izl3"); 422 446 }; 423 447 downloadButton.style.zIndex = "1000"; 424 448 ··· 604 628 $FJ(oSys, { 605 629 PicArr: [], 606 630 LoadAccess() { 631 + levelDataToLoad = undefined; 632 + 607 633 !oS.LvlVar ? (oS.LvlVar = { ScrollScreen: oS.ScrollScreen }) : (oS.LvlVar.ScrollScreen = oS.ScrollScreen); // 关卡数据 608 634 609 635 NewEle("dChosePanel", "div", "display:block;position:absolute;left:0px;top:0px", 0, EDAll, { class: "Almanac_ZombieBack" }); ··· 619 645 NewEle( 620 646 "dBack", 621 647 "div", 622 - "position:absolute;width:89px;height:26px;top:564px;left:700px;background-position:center top;background:url(images/interface/Almanac_CloseButton.png);cursor:url(images/interface/Pointer.cur),pointer;text-align:center;line-height:26px;color:rgb(40, 50, 90);font-size:12px;", 648 + "position:absolute;width:89px;height:26px;top:564px;left:700px;background-position:center top;background:url(images/interface/Almanac_CloseButton.png);cursor:url(images/interface/Pointer.cur),pointer;text-align:center;line-height:26px;color:#000080;font-size:12px;", 623 649 { 624 650 onmouseover() { 625 651 this.style.backgroundPosition = "bottom"; ··· 652 678 "div", 653 679 "text-align:center;line-height:60px;font-size:30px;font-weight:bold;font-family:黑体;color:#fff;position:relative;top:15px;", 654 680 { 655 - innerHTML: 'Night<br><font style="font-size:20px">Click here to select this mode</font>', 681 + innerHTML: 'Night<br><font style="font-size:20px">Click here to select</font>', 656 682 }, 657 683 $("dGrassDiv") 658 684 ); ··· 673 699 "div", 674 700 "text-align:center;line-height:60px;font-size:30px;font-weight:bold;font-family:黑体;color:#fff;position:relative;top:15px;", 675 701 { 676 - innerHTML: 'Night Pool<br><font style="font-size:20px">Click here to select this mode</font>', 702 + innerHTML: 'Night Pool<br><font style="font-size:20px">Click here to select</font>', 677 703 }, 678 704 $("dPoolDiv") 679 705 ); 680 706 707 + NewEle( 708 + "dFileDiv", 709 + "div", 710 + "left:410px;top:100px;background-image:url(images/interface/background2.jpg);display:block;position:absolute;z-index:100;cursor:url(images/interface/Pointer.cur),pointer;background-position:-25px,0px;background-size:324px,139px;background-repeat:no-repeat;width:275px;height:139px;border:5px solid rgba(255,255,255,0.5);border-radius:15px;", 711 + { 712 + async onclick() { 713 + // load the level 714 + const levelData = await fileToLevelData(); 715 + console.log(levelData); 716 + levelDataToLoad = levelData[0] === "=" ? parseCloneTiny_OLD(levelData) : parseCloneTiny(levelData); 717 + // load the izombiecustomlevel level 718 + if (levelDataToLoad.lfValue[3] === 2) { 719 + Change_Level("NPool"); 720 + } else { 721 + Change_Level("NGrass"); 722 + } 723 + }, 724 + }, 725 + EDAll 726 + ); 727 + NewEle( 728 + "dFileTXT", 729 + "div", 730 + "text-align:center;line-height:60px;font-size:30px;font-weight:bold;font-family:黑体;color:#fff;position:relative;top:15px;", 731 + { 732 + innerHTML: 'Load from File<br><font style="font-size:20px">Click here to select</font>', 733 + }, 734 + $("dFileDiv") 735 + ); 736 + 681 737 SetVisible($("dMenu")); // 显示菜单按钮 682 738 }, 683 739 LvlClearFunc() { ··· 688 744 $FJ(oPlt, {}), 689 745 $FJ(oWin, { 690 746 Return_Block() { 691 - SelectModal(0), HiddenOptions(); 747 + (SelectModal(0), HiddenOptions()); 692 748 SetBlock($("dSurface"), $("iSurfaceBackground")); 693 749 ShowRiddleGame(); 694 750 }, 695 751 }) 696 752 ); 697 753 }, 754 + // eslint-disable-next-line complexity 698 755 NGrass() { 699 756 // 黑夜草地 NGrass 700 757 oS.Init($FJ(oSys, { MapKind: "0" }), $FJ(oPlt, {}), $FJ(oWin, {})); 758 + // make sure everything in levelDataToLoad is defined 759 + if (typeof levelDataToLoad !== "undefined") { 760 + // make sure its a table the one with {} 761 + if (typeof levelDataToLoad !== "object") { 762 + alert("Invalid level data!"); 763 + SelectModal(0); 764 + } 765 + // make sure it has the right keys 766 + if ( 767 + !Object.hasOwn(levelDataToLoad, "plants") || 768 + !Object.hasOwn(levelDataToLoad, "music") || 769 + !Object.hasOwn(levelDataToLoad, "sun") || 770 + !Object.hasOwn(levelDataToLoad, "lfValue") || 771 + !Object.hasOwn(levelDataToLoad, "stripeCol") 772 + ) { 773 + /* alert("Invalid level data!"); 774 + SelectModal(0); */ 775 + levelDataToLoad = { 776 + lfValue: [0, 1, 1, 1, 1, 1], 777 + music: "Cerebrawl", 778 + name: "Error", 779 + plants: [ 780 + { 781 + plantCol: 1, 782 + plantName: "oWallNut", 783 + plantRow: 2, 784 + zIndex: 6, 785 + }, 786 + { 787 + plantCol: 1, 788 + plantName: "oWallNut", 789 + plantRow: 3, 790 + zIndex: 9, 791 + }, 792 + { 793 + plantCol: 1, 794 + plantName: "oWallNut", 795 + plantRow: 4, 796 + zIndex: 12, 797 + }, 798 + { 799 + plantCol: 1, 800 + plantName: "oWallNut", 801 + plantRow: 1, 802 + zIndex: 3, 803 + }, 804 + { 805 + plantCol: 2, 806 + plantName: "oWallNut", 807 + plantRow: 1, 808 + zIndex: 3, 809 + }, 810 + { 811 + plantCol: 2, 812 + plantName: "oWallNut", 813 + plantRow: 3, 814 + zIndex: 9, 815 + }, 816 + { 817 + plantCol: 1, 818 + plantName: "oWallNut", 819 + plantRow: 5, 820 + zIndex: 15, 821 + }, 822 + { 823 + plantCol: 2, 824 + plantName: "oWallNut", 825 + plantRow: 5, 826 + zIndex: 15, 827 + }, 828 + { 829 + plantCol: 4, 830 + plantName: "oWallNut", 831 + plantRow: 5, 832 + zIndex: 15, 833 + }, 834 + { 835 + plantCol: 4, 836 + plantName: "oWallNut", 837 + plantRow: 4, 838 + zIndex: 12, 839 + }, 840 + { 841 + plantCol: 5, 842 + plantName: "oWallNut", 843 + plantRow: 3, 844 + zIndex: 9, 845 + }, 846 + { 847 + plantCol: 4, 848 + plantName: "oWallNut", 849 + plantRow: 3, 850 + zIndex: 9, 851 + }, 852 + { 853 + plantCol: 7, 854 + plantName: "oWallNut", 855 + plantRow: 5, 856 + zIndex: 15, 857 + }, 858 + { 859 + plantCol: 7, 860 + plantName: "oWallNut", 861 + plantRow: 4, 862 + zIndex: 12, 863 + }, 864 + { 865 + plantCol: 7, 866 + plantName: "oWallNut", 867 + plantRow: 3, 868 + zIndex: 9, 869 + }, 870 + { 871 + plantCol: 8, 872 + plantName: "oWallNut", 873 + plantRow: 3, 874 + zIndex: 9, 875 + }, 876 + ], 877 + stripeCol: 9, 878 + sun: 0, 879 + }; 880 + } 881 + // make sure the keys are the right types 882 + if ( 883 + !Array.isArray(levelDataToLoad.plants) || 884 + typeof levelDataToLoad.music !== "string" || 885 + typeof levelDataToLoad.sun !== "number" || 886 + typeof levelDataToLoad.name !== "string" || 887 + !Array.isArray(levelDataToLoad.lfValue) || 888 + typeof levelDataToLoad.stripeCol !== "number" 889 + ) { 890 + alert("Invalid level data!"); 891 + SelectModal(0); 892 + } 893 + for (let i = 0; i < levelDataToLoad.plants.length; i++) { 894 + let plant = levelDataToLoad.plants[i]; 895 + if (!pNameValue.includes(window[plant.plantName])) { 896 + pNameValue.push(window[plant.plantName]); 897 + } 898 + } 899 + } 701 900 }, 901 + // eslint-disable-next-line complexity 702 902 NPool() { 703 903 // 黑夜泳池 NPool 704 904 oS.Init( ··· 746 946 $FJ(oPlt, {}), 747 947 $FJ(oWin, {}) 748 948 ); 949 + // make sure everything in levelDataToLoad is defined 950 + if (typeof levelDataToLoad !== "undefined") { 951 + // make sure its a table the one with {} 952 + if (typeof levelDataToLoad !== "object") { 953 + alert("Invalid level data!"); 954 + SelectModal(0); 955 + } 956 + // make sure it has the right keys 957 + if ( 958 + !Object.hasOwn(levelDataToLoad, "plants") || 959 + !Object.hasOwn(levelDataToLoad, "music") || 960 + !Object.hasOwn(levelDataToLoad, "sun") || 961 + !Object.hasOwn(levelDataToLoad, "lfValue") || 962 + !Object.hasOwn(levelDataToLoad, "stripeCol") 963 + ) { 964 + /* alert("Invalid level data!"); 965 + SelectModal(0); */ 966 + levelDataToLoad = { 967 + lfValue: [0, 1, 1, 2, 2, 1, 1], 968 + music: "Cerebrawl", 969 + name: "Error", 970 + plants: [ 971 + { 972 + plantCol: 2, 973 + plantName: "oWallNut", 974 + plantRow: 1, 975 + zIndex: 3, 976 + }, 977 + { 978 + plantCol: 1, 979 + plantName: "oWallNut", 980 + plantRow: 1, 981 + zIndex: 3, 982 + }, 983 + { 984 + plantCol: 1, 985 + plantName: "oLilyPad", 986 + plantRow: 3, 987 + zIndex: 9, 988 + }, 989 + { 990 + plantCol: 1, 991 + plantName: "oLilyPad", 992 + plantRow: 4, 993 + zIndex: 12, 994 + }, 995 + { 996 + plantCol: 1, 997 + plantName: "oWallNut", 998 + plantRow: 2, 999 + zIndex: 6, 1000 + }, 1001 + { 1002 + plantCol: 1, 1003 + plantName: "oWallNut", 1004 + plantRow: 3, 1005 + zIndex: 9, 1006 + }, 1007 + { 1008 + plantCol: 2, 1009 + plantName: "oLilyPad", 1010 + plantRow: 3, 1011 + zIndex: 9, 1012 + }, 1013 + { 1014 + plantCol: 2, 1015 + plantName: "oWallNut", 1016 + plantRow: 3, 1017 + zIndex: 9, 1018 + }, 1019 + { 1020 + plantCol: 1, 1021 + plantName: "oWallNut", 1022 + plantRow: 4, 1023 + zIndex: 12, 1024 + }, 1025 + { 1026 + plantCol: 1, 1027 + plantName: "oWallNut", 1028 + plantRow: 5, 1029 + zIndex: 15, 1030 + }, 1031 + { 1032 + plantCol: 2, 1033 + plantName: "oWallNut", 1034 + plantRow: 5, 1035 + zIndex: 15, 1036 + }, 1037 + { 1038 + plantCol: 4, 1039 + plantName: "oWallNut", 1040 + plantRow: 5, 1041 + zIndex: 15, 1042 + }, 1043 + { 1044 + plantCol: 4, 1045 + plantName: "oLilyPad", 1046 + plantRow: 4, 1047 + zIndex: 12, 1048 + }, 1049 + { 1050 + plantCol: 4, 1051 + plantName: "oLilyPad", 1052 + plantRow: 3, 1053 + zIndex: 9, 1054 + }, 1055 + { 1056 + plantCol: 4, 1057 + plantName: "oWallNut", 1058 + plantRow: 4, 1059 + zIndex: 12, 1060 + }, 1061 + { 1062 + plantCol: 4, 1063 + plantName: "oWallNut", 1064 + plantRow: 3, 1065 + zIndex: 9, 1066 + }, 1067 + { 1068 + plantCol: 5, 1069 + plantName: "oLilyPad", 1070 + plantRow: 3, 1071 + zIndex: 9, 1072 + }, 1073 + { 1074 + plantCol: 5, 1075 + plantName: "oWallNut", 1076 + plantRow: 3, 1077 + zIndex: 9, 1078 + }, 1079 + { 1080 + plantCol: 7, 1081 + plantName: "oWallNut", 1082 + plantRow: 5, 1083 + zIndex: 15, 1084 + }, 1085 + { 1086 + plantCol: 7, 1087 + plantName: "oLilyPad", 1088 + plantRow: 4, 1089 + zIndex: 12, 1090 + }, 1091 + { 1092 + plantCol: 7, 1093 + plantName: "oLilyPad", 1094 + plantRow: 3, 1095 + zIndex: 9, 1096 + }, 1097 + { 1098 + plantCol: 8, 1099 + plantName: "oLilyPad", 1100 + plantRow: 3, 1101 + zIndex: 9, 1102 + }, 1103 + { 1104 + plantCol: 7, 1105 + plantName: "oWallNut", 1106 + plantRow: 4, 1107 + zIndex: 12, 1108 + }, 1109 + { 1110 + plantCol: 7, 1111 + plantName: "oWallNut", 1112 + plantRow: 3, 1113 + zIndex: 9, 1114 + }, 1115 + { 1116 + plantCol: 8, 1117 + plantName: "oWallNut", 1118 + plantRow: 3, 1119 + zIndex: 9, 1120 + }, 1121 + ], 1122 + stripeCol: 9, 1123 + sun: 0, 1124 + }; 1125 + } 1126 + // make sure the keys are the right types 1127 + if ( 1128 + !Array.isArray(levelDataToLoad.plants) || 1129 + typeof levelDataToLoad.music !== "string" || 1130 + typeof levelDataToLoad.sun !== "number" || 1131 + typeof levelDataToLoad.name !== "string" || 1132 + !Array.isArray(levelDataToLoad.lfValue) || 1133 + typeof levelDataToLoad.stripeCol !== "number" 1134 + ) { 1135 + alert("Invalid level data!"); 1136 + SelectModal(0); 1137 + } 1138 + } 1139 + for (let i = 0; i < levelDataToLoad.plants.length; i++) { 1140 + let plant = levelDataToLoad.plants[i]; 1141 + if (!pNameValue.includes(window[plant.plantName])) { 1142 + pNameValue.push(window[plant.plantName]); 1143 + } 1144 + } 749 1145 }, 750 1146 default() { 751 1147 // 未知模式
+6 -1
game/level/izombiemenu.js
··· 91 91 }); 92 92 NewImg("imgSF", "images/interface/izombieload.png", "left:200px;top:410px", EDAll, { 93 93 onclick() { 94 - SelectModal("" + "izombiecustommenu" + ""); 94 + // SelectModal("" + "izombiecustommenu" + ""); 95 + LoadMenu("izombieonline", "images/interface/IZombie_Background.png"); 96 + PlayAudio("tap"); 97 + }, 98 + onmouseover() { 99 + PreloadMenu("izombieonline"); 95 100 }, 96 101 }); 97 102 },
+4 -4
game/level/vasebreaker1.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 VaseArP: { 81 81 GreenNum: 2,
+4 -4
game/level/vasebreaker2.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 VaseArP: { 81 81 GreenNum: 2,
+4 -4
game/level/vasebreaker3.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+4 -4
game/level/vasebreaker4.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+4 -4
game/level/vasebreaker5.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+4 -4
game/level/vasebreaker6.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+4 -4
game/level/vasebreaker7.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+4 -4
game/level/vasebreaker8.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+4 -4
game/level/vasebreaker9.js
··· 57 57 58 58 oFlowerVase.prototype.SpecialBirth(Pos[0], Pos[1], Top.Type === "Plants" ? GNum-- > 0 : 0, Top); // 生成罐子 59 59 60 - --VaseList.length, --GroundList.length; 60 + (--VaseList.length, --GroundList.length); 61 61 } 62 62 }, 63 63 StartGame() { 64 - oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop")); 65 - StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic)); 64 + (oP.Monitor(), SetVisible($("tdShovel"), $("dFlagMeter"), $("dTop"))); 65 + (StopMusic(), PlayMusic((oS.LoadMusic = oS.StartGameMusic))); 66 66 for (var i in ArCard) { 67 67 DoCoolTimer(i, 0); 68 68 } ··· 75 75 } 76 76 }; 77 77 78 - oS.RiddleAutoGrow(), f(); // f 的调用一定要在生成罐子后面 78 + (oS.RiddleAutoGrow(), f()); // f 的调用一定要在生成罐子后面 79 79 }, 80 80 81 81 VaseArP: {
+84
game/menu/html/izombieonline.html
··· 1 + <div class="iz-level-container"> 2 + <div class="iz-level" style="display: none" id="iz-level-template"> 3 + <button 4 + class="iz-level-report" 5 + onmouseout="SetHidden($('dTitle'))" 6 + onmousemove="ViewGenericMouseover(`<span style='color:red'><b>Report Abuse</b></span> - Report this level for inappropriate content`, event)" 7 + ></button> 8 + <h2 class="iz-level-title" title="{title}">{title}</h2> 9 + <div class="iz-level-thumbnail"> 10 + <img class="iz-level-thumbnail-background" src="images/interface/background2.jpg" /> 11 + </div> 12 + <div class="iz-level-stats"> 13 + <span id="author">{author}</span><br /> 14 + <span id="sun">{sun}</span><br /> 15 + <span id="downloads">{plays}</span><br /> 16 + <span id="favorites">{favorites}</span> 17 + </div> 18 + <button class="iz-level-play">Play Now</button> 19 + <input type="button" is="text-button" value="Favorite" class="iz-level-favorite" /> 20 + </div> 21 + </div> 22 + <div class="iz-reload button1" onmouseover="this.style.backgroundPosition = 'bottom'" onmouseout="this.style.backgroundPosition = 'top'">RELOAD</div> 23 + <div 24 + class="iz-sort button1" 25 + onmouseover="this.style.backgroundPosition = 'bottom'" 26 + onmouseout=" 27 + this.style.backgroundPosition = 'top'; 28 + SetHidden($('dTitle')); 29 + " 30 + > 31 + SORT 32 + </div> 33 + <div 34 + class="button1" 35 + onmouseover="this.style.backgroundPosition = 'bottom'" 36 + onmouseout="this.style.backgroundPosition = 'top'" 37 + onclick=" 38 + if (oS.Lvl == 'izombiecustommenu') { 39 + SelectModal('izombiemenu'); 40 + } else { 41 + PlayAudio('tap'); 42 + UnloadMenu('izombieonline'); 43 + } 44 + " 45 + style="padding-right: 30px; position: absolute; bottom: 7px; left: 10px" 46 + > 47 + I, ZOMBIE INDEX 48 + </div> 49 + <div 50 + class="button1" 51 + onmouseover="this.style.backgroundPosition = 'bottom'" 52 + onmouseout="this.style.backgroundPosition = 'top'" 53 + onclick=" 54 + if (oS.Lvl == 'izombiecustommenu') { 55 + PlayAudio('tap'); 56 + UnloadMenu('izombieonline'); 57 + } else { 58 + SelectModal('izombiecustommenu'); 59 + } 60 + " 61 + style="padding-right: 30px; position: absolute; bottom: 7px; left: 180px" 62 + > 63 + LOCAL LEVELS 64 + </div> 65 + <img 66 + src="images/interface/BackButton.png" 67 + style="bottom: 7px; right: 10px; cursor: url(images/interface/Pointer.cur), pointer" 68 + onclick=" 69 + SelectModal(0); 70 + SetBlock($('dSurface'), $('iSurfaceBackground')); 71 + " 72 + /> 73 + <!-- pagination button template --> 74 + <div class="iz-pagination"> 75 + <input type="button" is="text-button" value="<<" class="iz-pagination-button iz-pagination-first" disabled /> 76 + <input type="button" is="text-button" value="<" class="iz-pagination-button iz-pagination-prev" disabled /> 77 + <input type="button" is="text-button" value="-1" class="iz-pagination-button iz-pagination-back2" disabled /> 78 + <input type="button" is="text-button" value="0" class="iz-pagination-button iz-pagination-back1" disabled /> 79 + <input type="button" is="text-button" value="1" class="iz-pagination-button iz-pagination-current" /> 80 + <input type="button" is="text-button" value="2" class="iz-pagination-button iz-pagination-forward1" /> 81 + <input type="button" is="text-button" value="3" class="iz-pagination-button iz-pagination-forward2" /> 82 + <input type="button" is="text-button" value=">" class="iz-pagination-button iz-pagination-next" /> 83 + <input type="button" is="text-button" value=">>" class="iz-pagination-button iz-pagination-last" /> 84 + </div>
+272
game/menu/js/izombieonline.js
··· 1 + const levelContainer = menuContainer.querySelector(".iz-level-container"); 2 + const levelTemplate = levelContainer.querySelector("#iz-level-template"); 3 + const paginationContainer = menuContainer.querySelector(".iz-pagination"); 4 + 5 + const paginationButtons = { 6 + first: paginationContainer?.querySelector(".iz-pagination-first"), 7 + prev: paginationContainer?.querySelector(".iz-pagination-prev"), 8 + back2: paginationContainer?.querySelector(".iz-pagination-back2"), 9 + back1: paginationContainer?.querySelector(".iz-pagination-back1"), 10 + current: paginationContainer?.querySelector(".iz-pagination-current"), 11 + forward1: paginationContainer?.querySelector(".iz-pagination-forward1"), 12 + forward2: paginationContainer?.querySelector(".iz-pagination-forward2"), 13 + next: paginationContainer?.querySelector(".iz-pagination-next"), 14 + last: paginationContainer?.querySelector(".iz-pagination-last"), 15 + }; 16 + 17 + let page = 1; 18 + let limit = 12; 19 + let requestId = 0; 20 + let sorts = { 21 + plays: "Popular", 22 + recent: "Recent", 23 + favorites: "Favorites", 24 + }; 25 + let currentSortIndex = 0; 26 + 27 + document.querySelector(".iz-sort").addEventListener("click", (event) => { 28 + PlayAudio("tap"); 29 + currentSortIndex += 1; 30 + if (currentSortIndex === 3) { 31 + currentSortIndex = 0; 32 + } 33 + ViewGenericMouseover(`<b>Current Sort</b>: ${Object.values(sorts)[currentSortIndex]}`, event); 34 + clearLevels(); 35 + loadPage(page); 36 + }); 37 + 38 + document.querySelector(".iz-sort").addEventListener("mousemove", (event) => { 39 + ViewGenericMouseover(`<b>Current Sort</b>: ${Object.values(sorts)[currentSortIndex]}`, event); 40 + }); 41 + 42 + document.querySelector(".iz-reload").addEventListener("click", () => { 43 + PlayAudio("tap"); 44 + clearLevels(); 45 + loadPage(page); 46 + }); 47 + 48 + function renderThumbnail(thumb, thumbContainer) { 49 + thumb.forEach((plant) => { 50 + const img = document.createElement("img"); 51 + img.src = window[izombiePlantsMap[plant[0]]].prototype.PicArr[1]; 52 + img.style.position = "absolute"; 53 + img.style.left = `${plant[1] * 0.15}px`; 54 + img.style.top = `${plant[2] * 0.15}px`; 55 + img.style.width = `${plant[3] * 0.15}px`; 56 + img.style.height = `${plant[4] * 0.15}px`; 57 + img.style.transform = "scale(1.5)"; 58 + img.style.zIndex = plant[5]; 59 + img.className = "cardboardNoShadow"; 60 + thumbContainer.appendChild(img); 61 + }); 62 + } 63 + 64 + function createLevelCard(levelData) { 65 + const levelCard = levelTemplate.cloneNode(true); 66 + levelCard.id = `level-${levelData.id}`; 67 + levelCard.querySelector(".iz-level-title").textContent = levelData.name; 68 + levelCard.querySelector(".iz-level-title").title = levelData.name; 69 + levelCard.querySelector(".iz-level-stats > #author").textContent = levelData.author; 70 + levelCard.querySelector(".iz-level-stats > #sun").textContent = levelData.sun; 71 + levelCard.querySelector(".iz-level-stats > #downloads").textContent = levelData.plays; 72 + levelCard.querySelector(".iz-level-stats > #favorites").textContent = levelData.favorites; 73 + levelCard.querySelector(".iz-level-thumbnail-background").src = levelData.is_water 74 + ? "images/interface/background4.jpg" 75 + : "images/interface/background2.jpg"; 76 + renderThumbnail(levelData.thumbnail, levelCard.querySelector(".iz-level-thumbnail")); 77 + levelCard.style.display = null; 78 + 79 + levelCard.querySelector(".iz-level-report").onclick = () => { 80 + const reason = prompt("Tell us how you think this level is breaking the rules:"); 81 + const confirmation = confirm("Are you sure you want to report this level?"); 82 + if (!confirmation) { 83 + return; 84 + } 85 + // reason is optional 86 + fetch(`${$User.Server.URL}/api/levels/${levelData.id}/report`, { 87 + method: "POST", 88 + headers: { 89 + "Content-Type": "application/msgpack", 90 + }, 91 + body: msgpack.serialize({ reason }), 92 + }) 93 + .then((response) => { 94 + if (response.ok) { 95 + alert("Thank you for your report. Our team will review the level shortly."); 96 + } else { 97 + alert("There was an error submitting your report. Please try again later."); 98 + } 99 + }) 100 + .catch(() => { 101 + alert("There was an error submitting your report. Please try again later."); 102 + }); 103 + }; 104 + 105 + levelCard.querySelector(".iz-level-favorite").onclick = () => { 106 + fetch(`${$User.Server.URL}/api/levels/${levelData.id}/favorite`, { 107 + method: "POST", 108 + headers: { 109 + Accept: "application/msgpack", 110 + }, 111 + }) 112 + .then((response) => { 113 + if (response.ok) { 114 + const favCountElem = levelCard.querySelector(".iz-level-stats > #favorites"); 115 + // alert("Level favorited!"); 116 + response.arrayBuffer().then((data) => { 117 + const newFavCount = msgpack.deserialize(data).level.favorites; 118 + favCountElem.textContent = newFavCount; 119 + }); 120 + } else { 121 + alert("There was an error favoriting this level. Please try again later."); 122 + } 123 + }) 124 + .catch(() => { 125 + alert("There was an error favoriting this level. Please try again later."); 126 + }); 127 + }; 128 + 129 + levelCard.querySelector(".iz-level-play").onclick = () => { 130 + // fetch the level data from the server (responds with binary data) 131 + fetch(`${$User.Server.URL}/api/levels/${levelData.id}/download`, { 132 + method: "GET", 133 + }) 134 + .then((response) => response.arrayBuffer()) 135 + .then(async (arrayBuffer) => { 136 + // load the level 137 + const levelData = await fileToLevelData(arrayBuffer); 138 + console.log(levelData); 139 + levelDataToLoad = levelData[0] === "=" ? parseCloneTiny_OLD(levelData) : parseCloneTiny(levelData); 140 + // load the izombiecustomlevel level 141 + if (levelDataToLoad.lfValue[3] === 2) { 142 + SelectModal("izombiecustomlevelwater"); 143 + } else { 144 + SelectModal("izombiecustomlevelnormal"); 145 + } 146 + }) 147 + .catch((e) => { 148 + console.error(e); 149 + alert("There was an error loading the level. Please try again later."); 150 + }); 151 + }; 152 + 153 + return levelCard; 154 + } 155 + 156 + function setPaginationButtonVisible(button, visible) { 157 + if (!button) { 158 + return; 159 + } 160 + if (visible) { 161 + button.removeAttribute("disabled"); 162 + } else { 163 + button.setAttribute("disabled", ""); 164 + button.onclick = null; 165 + } 166 + } 167 + 168 + function setPaginationButtonPage(button, targetPage, currentPage, totalPages) { 169 + if (!button) { 170 + return; 171 + } 172 + const valid = Number.isInteger(targetPage) && targetPage >= 1 && targetPage <= totalPages; 173 + setPaginationButtonVisible(button, valid); 174 + if (!valid) { 175 + return; 176 + } 177 + 178 + button.value = String(targetPage); 179 + button.onclick = () => { 180 + if (targetPage !== currentPage) { 181 + void loadPage(targetPage); 182 + } 183 + }; 184 + } 185 + 186 + function renderPagination(pagination) { 187 + if (!paginationContainer) { 188 + return; 189 + } 190 + 191 + const currentPage = Number(pagination?.page ?? 1); 192 + const totalPages = Math.max(1, Number(pagination?.pages ?? 1)); 193 + 194 + if (totalPages <= 1) { 195 + paginationContainer.style.display = "none"; 196 + return; 197 + } 198 + paginationContainer.style.display = ""; 199 + 200 + // Current page is always shown. 201 + if (paginationButtons.current) { 202 + paginationButtons.current.value = String(currentPage); 203 + paginationButtons.current.onclick = null; 204 + setPaginationButtonVisible(paginationButtons.current, true); 205 + } 206 + 207 + // Navigation buttons. 208 + setPaginationButtonVisible(paginationButtons.first, currentPage > 1); 209 + if (paginationButtons.first) { 210 + paginationButtons.first.onclick = () => void loadPage(1); 211 + } 212 + 213 + setPaginationButtonVisible(paginationButtons.prev, currentPage > 1); 214 + if (paginationButtons.prev) { 215 + paginationButtons.prev.onclick = () => void loadPage(currentPage - 1); 216 + } 217 + 218 + setPaginationButtonVisible(paginationButtons.next, currentPage < totalPages); 219 + if (paginationButtons.next) { 220 + paginationButtons.next.onclick = () => void loadPage(currentPage + 1); 221 + } 222 + 223 + setPaginationButtonVisible(paginationButtons.last, currentPage < totalPages); 224 + if (paginationButtons.last) { 225 + paginationButtons.last.onclick = () => void loadPage(totalPages); 226 + } 227 + 228 + // Numbered neighbors. 229 + setPaginationButtonPage(paginationButtons.back2, currentPage - 2, currentPage, totalPages); 230 + setPaginationButtonPage(paginationButtons.back1, currentPage - 1, currentPage, totalPages); 231 + setPaginationButtonPage(paginationButtons.forward1, currentPage + 1, currentPage, totalPages); 232 + setPaginationButtonPage(paginationButtons.forward2, currentPage + 2, currentPage, totalPages); 233 + } 234 + 235 + function clearLevels() { 236 + for (const child of Array.from(levelContainer.children)) { 237 + if (child !== levelTemplate) { 238 + child.remove(); 239 + } 240 + } 241 + } 242 + 243 + async function loadPage(targetPage) { 244 + page = targetPage; 245 + const id = ++requestId; 246 + 247 + const response = await fetch(`${$User.Server.URL}/api/levels?page=${page}&limit=${limit}&sort=${Object.keys(sorts)[currentSortIndex]}`, { 248 + method: "GET", 249 + headers: { 250 + Accept: "application/msgpack", 251 + }, 252 + }); 253 + const data = msgpack.deserialize(await response.arrayBuffer()); 254 + if (id !== requestId) { 255 + return; 256 + } 257 + 258 + const levels = data.levels ?? []; 259 + const pagination = data.pagination ?? { page, limit, pages: 1, total: levels.length }; 260 + limit = Number(pagination.limit ?? limit); 261 + 262 + clearLevels(); 263 + levels.forEach((level) => { 264 + const levelCard = createLevelCard(level); 265 + levelContainer.appendChild(levelCard); 266 + }); 267 + 268 + renderPagination(pagination); 269 + } 270 + 271 + // fetch first page from server 272 + void loadPage(page);
+103
game/tester.html
··· 1 + <!doctype html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 + <link rel="stylesheet" href="Custom.css" /> 7 + <link rel="stylesheet" href="UI.css" /> 8 + <script src="js/WebComponents.js"></script> 9 + <script src="js/Cfunction.js"></script> 10 + <script src="js/CPlants.js"></script> 11 + <title>Document</title> 12 + </head> 13 + <body> 14 + <div id="iSurfaceBackground"> 15 + <div class="iz-level-thumbnail"> 16 + <img class="iz-level-thumbnail-background" src="images/interface/background2.jpg" /> 17 + </div> 18 + </div> 19 + <svg style="width: 0; height: 0"> 20 + <defs> 21 + <filter id="cardboardNoShadow" x="-50%" y="-50%" width="200%" height="200%"> 22 + <feColorMatrix 23 + type="matrix" 24 + values=" 25 + 1.25 0 0 0 0 26 + 0 0.788 0 0 0 27 + 0 0 0.627 0 0 28 + 0 0 0 1 0 29 + " 30 + result="coloredImage" 31 + ></feColorMatrix> 32 + 33 + <feComponentTransfer in="coloredImage" result="brightenedImage"> 34 + <feFuncR type="linear" slope="0.9"></feFuncR> 35 + <feFuncG type="linear" slope="0.9"></feFuncG> 36 + <feFuncB type="linear" slope="0.9"></feFuncB> 37 + <!-- Keep alpha unchanged --> 38 + <feFuncA type="identity"></feFuncA> 39 + </feComponentTransfer> 40 + 41 + <feColorMatrix 42 + type="matrix" 43 + values=" 44 + 0.9801 0.0199 0.0000 0 0 45 + 0.0000 0.9801 0.0199 0 0 46 + 0.0000 0.0000 0.9801 0 0 47 + 0 0 0 1 0 48 + " 49 + in="brightenedImage" 50 + result="sepiaEffect" 51 + ></feColorMatrix> 52 + 53 + <feColorMatrix 54 + type="matrix" 55 + values=" 56 + 0.393 0.769 0.189 0 0 57 + 0.349 0.686 0.168 0 0 58 + 0.272 0.534 0.131 0 0 59 + 0 0 0 1 0 60 + " 61 + in="SourceGraphic" 62 + result="fullSepia" 63 + /> 64 + <feBlend in="brightenedImage" in2="fullSepia" mode="normal" result="sepiaBlended" style="mix-blend-mode: lighten"></feBlend> 65 + 66 + <feColorMatrix 67 + type="matrix" 68 + values=" 69 + 1.25 0 0 0 0 70 + 0 0.788 0 0 0 71 + 0 0 0.627 0 0 72 + 0 0 0 1 0 73 + " 74 + in="SourceGraphic" 75 + result="coloredImage" 76 + ></feColorMatrix> 77 + <feComponentTransfer in="coloredImage" result="processedImage"> 78 + <feFuncR type="linear" slope="0.9"></feFuncR> 79 + <feFuncG type="linear" slope="0.9"></feFuncG> 80 + <feFuncB type="linear" slope="0.9"></feFuncB> 81 + <feFuncA type="identity"></feFuncA> 82 + </feComponentTransfer> 83 + </filter> 84 + </defs> 85 + </svg> 86 + <script> 87 + function renderThumbnail(thumb, thumbContainer) { 88 + thumb.forEach((plant) => { 89 + const img = document.createElement("img"); 90 + img.src = window[izombiePlantsMap[plant[0]]].prototype.PicArr[1]; 91 + img.style.position = "absolute"; 92 + img.style.left = `${plant[1] * 0.15}px`; 93 + img.style.top = `${plant[2] * 0.15}px`; 94 + img.style.width = `${plant[3] * 0.15}px`; 95 + img.style.height = `${plant[4] * 0.15}px`; 96 + img.style.transform = "scale(1.5)"; 97 + img.className = "cardboardNoShadow"; 98 + thumbContainer.appendChild(img); 99 + }); 100 + } 101 + </script> 102 + </body> 103 + </html>
+2 -2
index.html
··· 9 9 property="og:description" 10 10 content="Play Plants vs Zombies Modded here for Free - A tower defense game created by PopCap Games and released on May 5, 2009. Click to Play now! Mod by ROBLNET13 on Github." 11 11 /> 12 - <meta property="og:url" content="https://pvzm.net/game/iframe.html" /> 12 + <meta property="og:url" content="https://pvzm.net/game" /> 13 13 <meta property="og:site_name" content="ROBlNET13" /> 14 14 <meta property="og:image" content="https://pvzm.net/game/images/gamethumbnail5.png" /> 15 15 <meta property="og:image:alt" content="Plants vs. Zombies - MODDED" /> ··· 20 20 <meta name="twitter:description" content="Play Plants vs. Zombie Modded here for Free - Mod by ROBlNET13 on Github." /> 21 21 <meta name="twitter:image" content="https://pvzm.net/game/images/gamethumbnail5.png" /> 22 22 <meta name="google-site-verification" content="fJLVF6HtXXMM2ag1_bMLijwLhOVj9XWFtUb8KlkdS0I" /> 23 - <meta http-equiv="refresh" content="0; url=game/iframe.html" /> 23 + <meta http-equiv="refresh" content="0; url=/game" /> 24 24 </head> 25 25 </html>
+136 -2023
package-lock.json
··· 9 9 "version": "1.0.0", 10 10 "license": "CC-BY-NC-ND-4.0", 11 11 "devDependencies": { 12 - "@eslint/js": "^9.26.0", 13 - "clean-css": "^5.3.3", 14 - "eslint": "^9.26.0", 15 - "eslint-plugin-eqeqeq-fix": "^1.0.3", 16 - "globals": "^16.0.0", 17 12 "html-minifier-terser": "^7.2.0", 18 - "prettier": "^3.5.3", 13 + "oxfmt": "^0.24.0", 19 14 "terser": "^5.31.6", 20 15 "wrangler": "^4.54.0" 21 16 } ··· 159 154 } 160 155 }, 161 156 "node_modules/@emnapi/runtime": { 162 - "version": "1.8.0", 163 - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.0.tgz", 164 - "integrity": "sha512-Z82FDl1ByxqPEPrAYYeTQVlx2FSHPe1qwX465c+96IRS3fTdSYRoJcRxg3g2fEG5I69z1dSEWQlNRRr0/677mg==", 157 + "version": "1.8.1", 158 + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", 159 + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", 165 160 "dev": true, 166 161 "license": "MIT", 167 162 "optional": true, ··· 611 606 "node": ">=18" 612 607 } 613 608 }, 614 - "node_modules/@eslint-community/eslint-utils": { 615 - "version": "4.7.0", 616 - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", 617 - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", 618 - "dev": true, 619 - "license": "MIT", 620 - "dependencies": { 621 - "eslint-visitor-keys": "^3.4.3" 622 - }, 623 - "engines": { 624 - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 625 - }, 626 - "funding": { 627 - "url": "https://opencollective.com/eslint" 628 - }, 629 - "peerDependencies": { 630 - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" 631 - } 632 - }, 633 - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { 634 - "version": "3.4.3", 635 - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", 636 - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", 637 - "dev": true, 638 - "license": "Apache-2.0", 639 - "engines": { 640 - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 641 - }, 642 - "funding": { 643 - "url": "https://opencollective.com/eslint" 644 - } 645 - }, 646 - "node_modules/@eslint-community/regexpp": { 647 - "version": "4.12.1", 648 - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", 649 - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", 650 - "dev": true, 651 - "license": "MIT", 652 - "engines": { 653 - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 654 - } 655 - }, 656 - "node_modules/@eslint/config-array": { 657 - "version": "0.20.0", 658 - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", 659 - "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", 660 - "dev": true, 661 - "license": "Apache-2.0", 662 - "dependencies": { 663 - "@eslint/object-schema": "^2.1.6", 664 - "debug": "^4.3.1", 665 - "minimatch": "^3.1.2" 666 - }, 667 - "engines": { 668 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 669 - } 670 - }, 671 - "node_modules/@eslint/config-helpers": { 672 - "version": "0.2.2", 673 - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", 674 - "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", 675 - "dev": true, 676 - "license": "Apache-2.0", 677 - "engines": { 678 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 679 - } 680 - }, 681 - "node_modules/@eslint/core": { 682 - "version": "0.13.0", 683 - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", 684 - "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", 685 - "dev": true, 686 - "license": "Apache-2.0", 687 - "dependencies": { 688 - "@types/json-schema": "^7.0.15" 689 - }, 690 - "engines": { 691 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 692 - } 693 - }, 694 - "node_modules/@eslint/eslintrc": { 695 - "version": "3.3.1", 696 - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", 697 - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", 698 - "dev": true, 699 - "license": "MIT", 700 - "dependencies": { 701 - "ajv": "^6.12.4", 702 - "debug": "^4.3.2", 703 - "espree": "^10.0.1", 704 - "globals": "^14.0.0", 705 - "ignore": "^5.2.0", 706 - "import-fresh": "^3.2.1", 707 - "js-yaml": "^4.1.0", 708 - "minimatch": "^3.1.2", 709 - "strip-json-comments": "^3.1.1" 710 - }, 711 - "engines": { 712 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 713 - }, 714 - "funding": { 715 - "url": "https://opencollective.com/eslint" 716 - } 717 - }, 718 - "node_modules/@eslint/eslintrc/node_modules/globals": { 719 - "version": "14.0.0", 720 - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", 721 - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", 722 - "dev": true, 723 - "license": "MIT", 724 - "engines": { 725 - "node": ">=18" 726 - }, 727 - "funding": { 728 - "url": "https://github.com/sponsors/sindresorhus" 729 - } 730 - }, 731 - "node_modules/@eslint/js": { 732 - "version": "9.26.0", 733 - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz", 734 - "integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==", 735 - "dev": true, 736 - "license": "MIT", 737 - "engines": { 738 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 739 - } 740 - }, 741 - "node_modules/@eslint/object-schema": { 742 - "version": "2.1.6", 743 - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", 744 - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", 745 - "dev": true, 746 - "license": "Apache-2.0", 747 - "engines": { 748 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 749 - } 750 - }, 751 - "node_modules/@eslint/plugin-kit": { 752 - "version": "0.2.8", 753 - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", 754 - "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", 755 - "dev": true, 756 - "license": "Apache-2.0", 757 - "dependencies": { 758 - "@eslint/core": "^0.13.0", 759 - "levn": "^0.4.1" 760 - }, 761 - "engines": { 762 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 763 - } 764 - }, 765 - "node_modules/@humanfs/core": { 766 - "version": "0.19.1", 767 - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", 768 - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", 769 - "dev": true, 770 - "license": "Apache-2.0", 771 - "engines": { 772 - "node": ">=18.18.0" 773 - } 774 - }, 775 - "node_modules/@humanfs/node": { 776 - "version": "0.16.6", 777 - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", 778 - "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", 779 - "dev": true, 780 - "license": "Apache-2.0", 781 - "dependencies": { 782 - "@humanfs/core": "^0.19.1", 783 - "@humanwhocodes/retry": "^0.3.0" 784 - }, 785 - "engines": { 786 - "node": ">=18.18.0" 787 - } 788 - }, 789 - "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { 790 - "version": "0.3.1", 791 - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", 792 - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", 793 - "dev": true, 794 - "license": "Apache-2.0", 795 - "engines": { 796 - "node": ">=18.18" 797 - }, 798 - "funding": { 799 - "type": "github", 800 - "url": "https://github.com/sponsors/nzakas" 801 - } 802 - }, 803 - "node_modules/@humanwhocodes/module-importer": { 804 - "version": "1.0.1", 805 - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", 806 - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", 807 - "dev": true, 808 - "license": "Apache-2.0", 809 - "engines": { 810 - "node": ">=12.22" 811 - }, 812 - "funding": { 813 - "type": "github", 814 - "url": "https://github.com/sponsors/nzakas" 815 - } 816 - }, 817 - "node_modules/@humanwhocodes/retry": { 818 - "version": "0.4.3", 819 - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", 820 - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", 821 - "dev": true, 822 - "license": "Apache-2.0", 823 - "engines": { 824 - "node": ">=18.18" 825 - }, 826 - "funding": { 827 - "type": "github", 828 - "url": "https://github.com/sponsors/nzakas" 829 - } 830 - }, 831 609 "node_modules/@img/sharp-darwin-arm64": { 832 610 "version": "0.33.5", 833 611 "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", ··· 1258 1036 "@jridgewell/sourcemap-codec": "^1.4.14" 1259 1037 } 1260 1038 }, 1261 - "node_modules/@modelcontextprotocol/sdk": { 1262 - "version": "1.11.1", 1263 - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.11.1.tgz", 1264 - "integrity": "sha512-9LfmxKTb1v+vUS1/emSk1f5ePmTLkb9Le9AxOB5T0XM59EUumwcS45z05h7aiZx3GI0Bl7mjb3FMEglYj+acuQ==", 1039 + "node_modules/@oxfmt/darwin-arm64": { 1040 + "version": "0.24.0", 1041 + "resolved": "https://registry.npmjs.org/@oxfmt/darwin-arm64/-/darwin-arm64-0.24.0.tgz", 1042 + "integrity": "sha512-aYXuGf/yq8nsyEcHindGhiz9I+GEqLkVq8CfPbd+6VE259CpPEH+CaGHEO1j6vIOmNr8KHRq+IAjeRO2uJpb8A==", 1043 + "cpu": [ 1044 + "arm64" 1045 + ], 1265 1046 "dev": true, 1266 1047 "license": "MIT", 1267 - "dependencies": { 1268 - "content-type": "^1.0.5", 1269 - "cors": "^2.8.5", 1270 - "cross-spawn": "^7.0.3", 1271 - "eventsource": "^3.0.2", 1272 - "express": "^5.0.1", 1273 - "express-rate-limit": "^7.5.0", 1274 - "pkce-challenge": "^5.0.0", 1275 - "raw-body": "^3.0.0", 1276 - "zod": "^3.23.8", 1277 - "zod-to-json-schema": "^3.24.1" 1278 - }, 1279 - "engines": { 1280 - "node": ">=18" 1281 - } 1048 + "optional": true, 1049 + "os": [ 1050 + "darwin" 1051 + ] 1052 + }, 1053 + "node_modules/@oxfmt/darwin-x64": { 1054 + "version": "0.24.0", 1055 + "resolved": "https://registry.npmjs.org/@oxfmt/darwin-x64/-/darwin-x64-0.24.0.tgz", 1056 + "integrity": "sha512-vs3b8Bs53hbiNvcNeBilzE/+IhDTWKjSBB3v/ztr664nZk65j0xr+5IHMBNz3CFppmX7o/aBta2PxY+t+4KoPg==", 1057 + "cpu": [ 1058 + "x64" 1059 + ], 1060 + "dev": true, 1061 + "license": "MIT", 1062 + "optional": true, 1063 + "os": [ 1064 + "darwin" 1065 + ] 1066 + }, 1067 + "node_modules/@oxfmt/linux-arm64-gnu": { 1068 + "version": "0.24.0", 1069 + "resolved": "https://registry.npmjs.org/@oxfmt/linux-arm64-gnu/-/linux-arm64-gnu-0.24.0.tgz", 1070 + "integrity": "sha512-ItPDOPoQ0wLj/s8osc5ch57uUcA1Wk8r0YdO8vLRpXA3UNg7KPOm1vdbkIZRRiSUphZcuX5ioOEetEK8H7RlTw==", 1071 + "cpu": [ 1072 + "arm64" 1073 + ], 1074 + "dev": true, 1075 + "license": "MIT", 1076 + "optional": true, 1077 + "os": [ 1078 + "linux" 1079 + ] 1080 + }, 1081 + "node_modules/@oxfmt/linux-arm64-musl": { 1082 + "version": "0.24.0", 1083 + "resolved": "https://registry.npmjs.org/@oxfmt/linux-arm64-musl/-/linux-arm64-musl-0.24.0.tgz", 1084 + "integrity": "sha512-JkQO3WnQjQTJONx8nxdgVBfl6BBFfpp9bKhChYhWeakwJdr7QPOAWJ/v3FGZfr0TbqINwnNR74aVZayDDRyXEA==", 1085 + "cpu": [ 1086 + "arm64" 1087 + ], 1088 + "dev": true, 1089 + "license": "MIT", 1090 + "optional": true, 1091 + "os": [ 1092 + "linux" 1093 + ] 1094 + }, 1095 + "node_modules/@oxfmt/linux-x64-gnu": { 1096 + "version": "0.24.0", 1097 + "resolved": "https://registry.npmjs.org/@oxfmt/linux-x64-gnu/-/linux-x64-gnu-0.24.0.tgz", 1098 + "integrity": "sha512-N/SXlFO+2kak5gMt0oxApi0WXQDhwA0PShR0UbkY0PwtHjfSiDqJSOumyNqgQVoroKr1GNnoRmUqjZIz6DKIcw==", 1099 + "cpu": [ 1100 + "x64" 1101 + ], 1102 + "dev": true, 1103 + "license": "MIT", 1104 + "optional": true, 1105 + "os": [ 1106 + "linux" 1107 + ] 1108 + }, 1109 + "node_modules/@oxfmt/linux-x64-musl": { 1110 + "version": "0.24.0", 1111 + "resolved": "https://registry.npmjs.org/@oxfmt/linux-x64-musl/-/linux-x64-musl-0.24.0.tgz", 1112 + "integrity": "sha512-WM0pek5YDCQf50XQ7GLCE9sMBCMPW/NPAEPH/Hx6Qyir37lEsP4rUmSECo/QFNTU6KBc9NnsviAyJruWPpCMXw==", 1113 + "cpu": [ 1114 + "x64" 1115 + ], 1116 + "dev": true, 1117 + "license": "MIT", 1118 + "optional": true, 1119 + "os": [ 1120 + "linux" 1121 + ] 1122 + }, 1123 + "node_modules/@oxfmt/win32-arm64": { 1124 + "version": "0.24.0", 1125 + "resolved": "https://registry.npmjs.org/@oxfmt/win32-arm64/-/win32-arm64-0.24.0.tgz", 1126 + "integrity": "sha512-vFCseli1KWtwdHrVlT/jWfZ8jP8oYpnPPEjI23mPLW8K/6GEJmmvy0PZP5NpWUFNTzX0lqie58XnrATJYAe9Xw==", 1127 + "cpu": [ 1128 + "arm64" 1129 + ], 1130 + "dev": true, 1131 + "license": "MIT", 1132 + "optional": true, 1133 + "os": [ 1134 + "win32" 1135 + ] 1136 + }, 1137 + "node_modules/@oxfmt/win32-x64": { 1138 + "version": "0.24.0", 1139 + "resolved": "https://registry.npmjs.org/@oxfmt/win32-x64/-/win32-x64-0.24.0.tgz", 1140 + "integrity": "sha512-0tmlNzcyewAnauNeBCq0xmAkmiKzl+H09p0IdHy+QKrTQdtixtf+AOjDAADbRfihkS+heF15Pjc4IyJMdAAJjw==", 1141 + "cpu": [ 1142 + "x64" 1143 + ], 1144 + "dev": true, 1145 + "license": "MIT", 1146 + "optional": true, 1147 + "os": [ 1148 + "win32" 1149 + ] 1282 1150 }, 1283 1151 "node_modules/@poppinss/colors": { 1284 1152 "version": "4.1.6", ··· 1342 1210 "dev": true, 1343 1211 "license": "CC0-1.0" 1344 1212 }, 1345 - "node_modules/@types/estree": { 1346 - "version": "1.0.7", 1347 - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", 1348 - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", 1349 - "dev": true, 1350 - "license": "MIT" 1351 - }, 1352 - "node_modules/@types/json-schema": { 1353 - "version": "7.0.15", 1354 - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", 1355 - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", 1356 - "dev": true, 1357 - "license": "MIT" 1358 - }, 1359 - "node_modules/accepts": { 1360 - "version": "2.0.0", 1361 - "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", 1362 - "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", 1363 - "dev": true, 1364 - "license": "MIT", 1365 - "dependencies": { 1366 - "mime-types": "^3.0.0", 1367 - "negotiator": "^1.0.0" 1368 - }, 1369 - "engines": { 1370 - "node": ">= 0.6" 1371 - } 1372 - }, 1373 1213 "node_modules/acorn": { 1374 1214 "version": "8.15.0", 1375 1215 "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", 1376 1216 "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", 1377 1217 "dev": true, 1378 1218 "license": "MIT", 1379 - "peer": true, 1380 1219 "bin": { 1381 1220 "acorn": "bin/acorn" 1382 1221 }, ··· 1384 1223 "node": ">=0.4.0" 1385 1224 } 1386 1225 }, 1387 - "node_modules/acorn-jsx": { 1388 - "version": "5.3.2", 1389 - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", 1390 - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", 1391 - "dev": true, 1392 - "license": "MIT", 1393 - "peerDependencies": { 1394 - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 1395 - } 1396 - }, 1397 1226 "node_modules/acorn-walk": { 1398 1227 "version": "8.3.2", 1399 1228 "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", ··· 1404 1233 "node": ">=0.4.0" 1405 1234 } 1406 1235 }, 1407 - "node_modules/ajv": { 1408 - "version": "6.12.6", 1409 - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 1410 - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 1411 - "dev": true, 1412 - "license": "MIT", 1413 - "dependencies": { 1414 - "fast-deep-equal": "^3.1.1", 1415 - "fast-json-stable-stringify": "^2.0.0", 1416 - "json-schema-traverse": "^0.4.1", 1417 - "uri-js": "^4.2.2" 1418 - }, 1419 - "funding": { 1420 - "type": "github", 1421 - "url": "https://github.com/sponsors/epoberezkin" 1422 - } 1423 - }, 1424 - "node_modules/ansi-styles": { 1425 - "version": "4.3.0", 1426 - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 1427 - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 1428 - "dev": true, 1429 - "license": "MIT", 1430 - "dependencies": { 1431 - "color-convert": "^2.0.1" 1432 - }, 1433 - "engines": { 1434 - "node": ">=8" 1435 - }, 1436 - "funding": { 1437 - "url": "https://github.com/chalk/ansi-styles?sponsor=1" 1438 - } 1439 - }, 1440 - "node_modules/argparse": { 1441 - "version": "2.0.1", 1442 - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 1443 - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 1444 - "dev": true, 1445 - "license": "Python-2.0" 1446 - }, 1447 - "node_modules/balanced-match": { 1448 - "version": "1.0.2", 1449 - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 1450 - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 1451 - "dev": true, 1452 - "license": "MIT" 1453 - }, 1454 1236 "node_modules/blake3-wasm": { 1455 1237 "version": "2.1.5", 1456 1238 "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", ··· 1458 1240 "dev": true, 1459 1241 "license": "MIT" 1460 1242 }, 1461 - "node_modules/body-parser": { 1462 - "version": "2.2.0", 1463 - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", 1464 - "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", 1465 - "dev": true, 1466 - "license": "MIT", 1467 - "dependencies": { 1468 - "bytes": "^3.1.2", 1469 - "content-type": "^1.0.5", 1470 - "debug": "^4.4.0", 1471 - "http-errors": "^2.0.0", 1472 - "iconv-lite": "^0.6.3", 1473 - "on-finished": "^2.4.1", 1474 - "qs": "^6.14.0", 1475 - "raw-body": "^3.0.0", 1476 - "type-is": "^2.0.0" 1477 - }, 1478 - "engines": { 1479 - "node": ">=18" 1480 - } 1481 - }, 1482 - "node_modules/brace-expansion": { 1483 - "version": "1.1.11", 1484 - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 1485 - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 1486 - "dev": true, 1487 - "license": "MIT", 1488 - "dependencies": { 1489 - "balanced-match": "^1.0.0", 1490 - "concat-map": "0.0.1" 1491 - } 1492 - }, 1493 1243 "node_modules/buffer-from": { 1494 1244 "version": "1.1.2", 1495 1245 "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", ··· 1497 1247 "dev": true, 1498 1248 "license": "MIT" 1499 1249 }, 1500 - "node_modules/bytes": { 1501 - "version": "3.1.2", 1502 - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 1503 - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 1504 - "dev": true, 1505 - "license": "MIT", 1506 - "engines": { 1507 - "node": ">= 0.8" 1508 - } 1509 - }, 1510 - "node_modules/call-bind-apply-helpers": { 1511 - "version": "1.0.2", 1512 - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", 1513 - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", 1514 - "dev": true, 1515 - "license": "MIT", 1516 - "dependencies": { 1517 - "es-errors": "^1.3.0", 1518 - "function-bind": "^1.1.2" 1519 - }, 1520 - "engines": { 1521 - "node": ">= 0.4" 1522 - } 1523 - }, 1524 - "node_modules/call-bound": { 1525 - "version": "1.0.4", 1526 - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", 1527 - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", 1528 - "dev": true, 1529 - "license": "MIT", 1530 - "dependencies": { 1531 - "call-bind-apply-helpers": "^1.0.2", 1532 - "get-intrinsic": "^1.3.0" 1533 - }, 1534 - "engines": { 1535 - "node": ">= 0.4" 1536 - }, 1537 - "funding": { 1538 - "url": "https://github.com/sponsors/ljharb" 1539 - } 1540 - }, 1541 - "node_modules/callsites": { 1542 - "version": "3.1.0", 1543 - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 1544 - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 1545 - "dev": true, 1546 - "license": "MIT", 1547 - "engines": { 1548 - "node": ">=6" 1549 - } 1550 - }, 1551 1250 "node_modules/camel-case": { 1552 1251 "version": "4.1.2", 1553 1252 "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", ··· 1559 1258 "tslib": "^2.0.3" 1560 1259 } 1561 1260 }, 1562 - "node_modules/chalk": { 1563 - "version": "4.1.2", 1564 - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 1565 - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 1566 - "dev": true, 1567 - "license": "MIT", 1568 - "dependencies": { 1569 - "ansi-styles": "^4.1.0", 1570 - "supports-color": "^7.1.0" 1571 - }, 1572 - "engines": { 1573 - "node": ">=10" 1574 - }, 1575 - "funding": { 1576 - "url": "https://github.com/chalk/chalk?sponsor=1" 1577 - } 1578 - }, 1579 1261 "node_modules/clean-css": { 1580 1262 "version": "5.3.3", 1581 1263 "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", ··· 1644 1326 "node": ">=14" 1645 1327 } 1646 1328 }, 1647 - "node_modules/concat-map": { 1648 - "version": "0.0.1", 1649 - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 1650 - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 1651 - "dev": true, 1652 - "license": "MIT" 1653 - }, 1654 - "node_modules/content-disposition": { 1655 - "version": "1.0.0", 1656 - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", 1657 - "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", 1658 - "dev": true, 1659 - "license": "MIT", 1660 - "dependencies": { 1661 - "safe-buffer": "5.2.1" 1662 - }, 1663 - "engines": { 1664 - "node": ">= 0.6" 1665 - } 1666 - }, 1667 - "node_modules/content-type": { 1668 - "version": "1.0.5", 1669 - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 1670 - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 1671 - "dev": true, 1672 - "license": "MIT", 1673 - "engines": { 1674 - "node": ">= 0.6" 1675 - } 1676 - }, 1677 - "node_modules/cookie": { 1678 - "version": "0.7.2", 1679 - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", 1680 - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", 1681 - "dev": true, 1682 - "license": "MIT", 1683 - "engines": { 1684 - "node": ">= 0.6" 1685 - } 1686 - }, 1687 - "node_modules/cookie-signature": { 1688 - "version": "1.2.2", 1689 - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", 1690 - "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", 1691 - "dev": true, 1692 - "license": "MIT", 1693 - "engines": { 1694 - "node": ">=6.6.0" 1695 - } 1696 - }, 1697 - "node_modules/cors": { 1698 - "version": "2.8.5", 1699 - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 1700 - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 1701 - "dev": true, 1702 - "license": "MIT", 1703 - "dependencies": { 1704 - "object-assign": "^4", 1705 - "vary": "^1" 1706 - }, 1707 - "engines": { 1708 - "node": ">= 0.10" 1709 - } 1710 - }, 1711 - "node_modules/cross-spawn": { 1712 - "version": "7.0.6", 1713 - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 1714 - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 1715 - "dev": true, 1716 - "license": "MIT", 1717 - "dependencies": { 1718 - "path-key": "^3.1.0", 1719 - "shebang-command": "^2.0.0", 1720 - "which": "^2.0.1" 1721 - }, 1722 - "engines": { 1723 - "node": ">= 8" 1724 - } 1725 - }, 1726 - "node_modules/debug": { 1727 - "version": "4.4.0", 1728 - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", 1729 - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", 1730 - "dev": true, 1731 - "license": "MIT", 1732 - "dependencies": { 1733 - "ms": "^2.1.3" 1734 - }, 1735 - "engines": { 1736 - "node": ">=6.0" 1737 - }, 1738 - "peerDependenciesMeta": { 1739 - "supports-color": { 1740 - "optional": true 1741 - } 1742 - } 1743 - }, 1744 - "node_modules/deep-is": { 1745 - "version": "0.1.4", 1746 - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", 1747 - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 1748 - "dev": true, 1749 - "license": "MIT" 1750 - }, 1751 - "node_modules/depd": { 1752 - "version": "2.0.0", 1753 - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 1754 - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 1755 - "dev": true, 1756 - "license": "MIT", 1757 - "engines": { 1758 - "node": ">= 0.8" 1759 - } 1760 - }, 1761 1329 "node_modules/detect-libc": { 1762 1330 "version": "2.1.2", 1763 1331 "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", ··· 1779 1347 "tslib": "^2.0.3" 1780 1348 } 1781 1349 }, 1782 - "node_modules/dunder-proto": { 1783 - "version": "1.0.1", 1784 - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", 1785 - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", 1786 - "dev": true, 1787 - "license": "MIT", 1788 - "dependencies": { 1789 - "call-bind-apply-helpers": "^1.0.1", 1790 - "es-errors": "^1.3.0", 1791 - "gopd": "^1.2.0" 1792 - }, 1793 - "engines": { 1794 - "node": ">= 0.4" 1795 - } 1796 - }, 1797 - "node_modules/ee-first": { 1798 - "version": "1.1.1", 1799 - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 1800 - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", 1801 - "dev": true, 1802 - "license": "MIT" 1803 - }, 1804 - "node_modules/encodeurl": { 1805 - "version": "2.0.0", 1806 - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", 1807 - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", 1808 - "dev": true, 1809 - "license": "MIT", 1810 - "engines": { 1811 - "node": ">= 0.8" 1812 - } 1813 - }, 1814 1350 "node_modules/entities": { 1815 1351 "version": "4.5.0", 1816 1352 "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", ··· 1834 1370 "url": "https://github.com/sponsors/antfu" 1835 1371 } 1836 1372 }, 1837 - "node_modules/es-define-property": { 1838 - "version": "1.0.1", 1839 - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", 1840 - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", 1841 - "dev": true, 1842 - "license": "MIT", 1843 - "engines": { 1844 - "node": ">= 0.4" 1845 - } 1846 - }, 1847 - "node_modules/es-errors": { 1848 - "version": "1.3.0", 1849 - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 1850 - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 1851 - "dev": true, 1852 - "license": "MIT", 1853 - "engines": { 1854 - "node": ">= 0.4" 1855 - } 1856 - }, 1857 - "node_modules/es-object-atoms": { 1858 - "version": "1.1.1", 1859 - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", 1860 - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", 1861 - "dev": true, 1862 - "license": "MIT", 1863 - "dependencies": { 1864 - "es-errors": "^1.3.0" 1865 - }, 1866 - "engines": { 1867 - "node": ">= 0.4" 1868 - } 1869 - }, 1870 1373 "node_modules/esbuild": { 1871 1374 "version": "0.27.0", 1872 1375 "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.0.tgz", ··· 1909 1412 "@esbuild/win32-x64": "0.27.0" 1910 1413 } 1911 1414 }, 1912 - "node_modules/escape-html": { 1913 - "version": "1.0.3", 1914 - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 1915 - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", 1916 - "dev": true, 1917 - "license": "MIT" 1918 - }, 1919 - "node_modules/escape-string-regexp": { 1920 - "version": "4.0.0", 1921 - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 1922 - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 1923 - "dev": true, 1924 - "license": "MIT", 1925 - "engines": { 1926 - "node": ">=10" 1927 - }, 1928 - "funding": { 1929 - "url": "https://github.com/sponsors/sindresorhus" 1930 - } 1931 - }, 1932 - "node_modules/eslint": { 1933 - "version": "9.26.0", 1934 - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.26.0.tgz", 1935 - "integrity": "sha512-Hx0MOjPh6uK9oq9nVsATZKE/Wlbai7KFjfCuw9UHaguDW3x+HF0O5nIi3ud39TWgrTjTO5nHxmL3R1eANinWHQ==", 1936 - "dev": true, 1937 - "license": "MIT", 1938 - "peer": true, 1939 - "dependencies": { 1940 - "@eslint-community/eslint-utils": "^4.2.0", 1941 - "@eslint-community/regexpp": "^4.12.1", 1942 - "@eslint/config-array": "^0.20.0", 1943 - "@eslint/config-helpers": "^0.2.1", 1944 - "@eslint/core": "^0.13.0", 1945 - "@eslint/eslintrc": "^3.3.1", 1946 - "@eslint/js": "9.26.0", 1947 - "@eslint/plugin-kit": "^0.2.8", 1948 - "@humanfs/node": "^0.16.6", 1949 - "@humanwhocodes/module-importer": "^1.0.1", 1950 - "@humanwhocodes/retry": "^0.4.2", 1951 - "@modelcontextprotocol/sdk": "^1.8.0", 1952 - "@types/estree": "^1.0.6", 1953 - "@types/json-schema": "^7.0.15", 1954 - "ajv": "^6.12.4", 1955 - "chalk": "^4.0.0", 1956 - "cross-spawn": "^7.0.6", 1957 - "debug": "^4.3.2", 1958 - "escape-string-regexp": "^4.0.0", 1959 - "eslint-scope": "^8.3.0", 1960 - "eslint-visitor-keys": "^4.2.0", 1961 - "espree": "^10.3.0", 1962 - "esquery": "^1.5.0", 1963 - "esutils": "^2.0.2", 1964 - "fast-deep-equal": "^3.1.3", 1965 - "file-entry-cache": "^8.0.0", 1966 - "find-up": "^5.0.0", 1967 - "glob-parent": "^6.0.2", 1968 - "ignore": "^5.2.0", 1969 - "imurmurhash": "^0.1.4", 1970 - "is-glob": "^4.0.0", 1971 - "json-stable-stringify-without-jsonify": "^1.0.1", 1972 - "lodash.merge": "^4.6.2", 1973 - "minimatch": "^3.1.2", 1974 - "natural-compare": "^1.4.0", 1975 - "optionator": "^0.9.3", 1976 - "zod": "^3.24.2" 1977 - }, 1978 - "bin": { 1979 - "eslint": "bin/eslint.js" 1980 - }, 1981 - "engines": { 1982 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1983 - }, 1984 - "funding": { 1985 - "url": "https://eslint.org/donate" 1986 - }, 1987 - "peerDependencies": { 1988 - "jiti": "*" 1989 - }, 1990 - "peerDependenciesMeta": { 1991 - "jiti": { 1992 - "optional": true 1993 - } 1994 - } 1995 - }, 1996 - "node_modules/eslint-plugin-eqeqeq-fix": { 1997 - "version": "1.0.3", 1998 - "resolved": "https://registry.npmjs.org/eslint-plugin-eqeqeq-fix/-/eslint-plugin-eqeqeq-fix-1.0.3.tgz", 1999 - "integrity": "sha512-P1rvtn3iyMJGmF8zU6Q5+boNhYr+c+L4V3lLNGjNornLdZgXScekItxpxZdwKRXpZI30JmszVBH8U4hRj3Ly/Q==", 2000 - "dev": true, 2001 - "license": "GPL-3.0" 2002 - }, 2003 - "node_modules/eslint-scope": { 2004 - "version": "8.3.0", 2005 - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", 2006 - "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", 2007 - "dev": true, 2008 - "license": "BSD-2-Clause", 2009 - "dependencies": { 2010 - "esrecurse": "^4.3.0", 2011 - "estraverse": "^5.2.0" 2012 - }, 2013 - "engines": { 2014 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 2015 - }, 2016 - "funding": { 2017 - "url": "https://opencollective.com/eslint" 2018 - } 2019 - }, 2020 - "node_modules/eslint-visitor-keys": { 2021 - "version": "4.2.0", 2022 - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", 2023 - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", 2024 - "dev": true, 2025 - "license": "Apache-2.0", 2026 - "engines": { 2027 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 2028 - }, 2029 - "funding": { 2030 - "url": "https://opencollective.com/eslint" 2031 - } 2032 - }, 2033 - "node_modules/espree": { 2034 - "version": "10.3.0", 2035 - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", 2036 - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", 2037 - "dev": true, 2038 - "license": "BSD-2-Clause", 2039 - "dependencies": { 2040 - "acorn": "^8.14.0", 2041 - "acorn-jsx": "^5.3.2", 2042 - "eslint-visitor-keys": "^4.2.0" 2043 - }, 2044 - "engines": { 2045 - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 2046 - }, 2047 - "funding": { 2048 - "url": "https://opencollective.com/eslint" 2049 - } 2050 - }, 2051 - "node_modules/esquery": { 2052 - "version": "1.6.0", 2053 - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", 2054 - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", 2055 - "dev": true, 2056 - "license": "BSD-3-Clause", 2057 - "dependencies": { 2058 - "estraverse": "^5.1.0" 2059 - }, 2060 - "engines": { 2061 - "node": ">=0.10" 2062 - } 2063 - }, 2064 - "node_modules/esrecurse": { 2065 - "version": "4.3.0", 2066 - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 2067 - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 2068 - "dev": true, 2069 - "license": "BSD-2-Clause", 2070 - "dependencies": { 2071 - "estraverse": "^5.2.0" 2072 - }, 2073 - "engines": { 2074 - "node": ">=4.0" 2075 - } 2076 - }, 2077 - "node_modules/estraverse": { 2078 - "version": "5.3.0", 2079 - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 2080 - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 2081 - "dev": true, 2082 - "license": "BSD-2-Clause", 2083 - "engines": { 2084 - "node": ">=4.0" 2085 - } 2086 - }, 2087 - "node_modules/esutils": { 2088 - "version": "2.0.3", 2089 - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 2090 - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 2091 - "dev": true, 2092 - "license": "BSD-2-Clause", 2093 - "engines": { 2094 - "node": ">=0.10.0" 2095 - } 2096 - }, 2097 - "node_modules/etag": { 2098 - "version": "1.8.1", 2099 - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 2100 - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 2101 - "dev": true, 2102 - "license": "MIT", 2103 - "engines": { 2104 - "node": ">= 0.6" 2105 - } 2106 - }, 2107 - "node_modules/eventsource": { 2108 - "version": "3.0.7", 2109 - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", 2110 - "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", 2111 - "dev": true, 2112 - "license": "MIT", 2113 - "dependencies": { 2114 - "eventsource-parser": "^3.0.1" 2115 - }, 2116 - "engines": { 2117 - "node": ">=18.0.0" 2118 - } 2119 - }, 2120 - "node_modules/eventsource-parser": { 2121 - "version": "3.0.1", 2122 - "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.1.tgz", 2123 - "integrity": "sha512-VARTJ9CYeuQYb0pZEPbzi740OWFgpHe7AYJ2WFZVnUDUQp5Dk2yJUgF36YsZ81cOyxT0QxmXD2EQpapAouzWVA==", 2124 - "dev": true, 2125 - "license": "MIT", 2126 - "engines": { 2127 - "node": ">=18.0.0" 2128 - } 2129 - }, 2130 1415 "node_modules/exit-hook": { 2131 1416 "version": "2.2.1", 2132 1417 "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz", ··· 2140 1425 "url": "https://github.com/sponsors/sindresorhus" 2141 1426 } 2142 1427 }, 2143 - "node_modules/express": { 2144 - "version": "5.1.0", 2145 - "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", 2146 - "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", 2147 - "dev": true, 2148 - "license": "MIT", 2149 - "peer": true, 2150 - "dependencies": { 2151 - "accepts": "^2.0.0", 2152 - "body-parser": "^2.2.0", 2153 - "content-disposition": "^1.0.0", 2154 - "content-type": "^1.0.5", 2155 - "cookie": "^0.7.1", 2156 - "cookie-signature": "^1.2.1", 2157 - "debug": "^4.4.0", 2158 - "encodeurl": "^2.0.0", 2159 - "escape-html": "^1.0.3", 2160 - "etag": "^1.8.1", 2161 - "finalhandler": "^2.1.0", 2162 - "fresh": "^2.0.0", 2163 - "http-errors": "^2.0.0", 2164 - "merge-descriptors": "^2.0.0", 2165 - "mime-types": "^3.0.0", 2166 - "on-finished": "^2.4.1", 2167 - "once": "^1.4.0", 2168 - "parseurl": "^1.3.3", 2169 - "proxy-addr": "^2.0.7", 2170 - "qs": "^6.14.0", 2171 - "range-parser": "^1.2.1", 2172 - "router": "^2.2.0", 2173 - "send": "^1.1.0", 2174 - "serve-static": "^2.2.0", 2175 - "statuses": "^2.0.1", 2176 - "type-is": "^2.0.1", 2177 - "vary": "^1.1.2" 2178 - }, 2179 - "engines": { 2180 - "node": ">= 18" 2181 - }, 2182 - "funding": { 2183 - "type": "opencollective", 2184 - "url": "https://opencollective.com/express" 2185 - } 2186 - }, 2187 - "node_modules/express-rate-limit": { 2188 - "version": "7.5.0", 2189 - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", 2190 - "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", 2191 - "dev": true, 2192 - "license": "MIT", 2193 - "engines": { 2194 - "node": ">= 16" 2195 - }, 2196 - "funding": { 2197 - "url": "https://github.com/sponsors/express-rate-limit" 2198 - }, 2199 - "peerDependencies": { 2200 - "express": "^4.11 || 5 || ^5.0.0-beta.1" 2201 - } 2202 - }, 2203 - "node_modules/fast-deep-equal": { 2204 - "version": "3.1.3", 2205 - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 2206 - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 2207 - "dev": true, 2208 - "license": "MIT" 2209 - }, 2210 - "node_modules/fast-json-stable-stringify": { 2211 - "version": "2.1.0", 2212 - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 2213 - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 2214 - "dev": true, 2215 - "license": "MIT" 2216 - }, 2217 - "node_modules/fast-levenshtein": { 2218 - "version": "2.0.6", 2219 - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 2220 - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 2221 - "dev": true, 2222 - "license": "MIT" 2223 - }, 2224 - "node_modules/file-entry-cache": { 2225 - "version": "8.0.0", 2226 - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", 2227 - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", 2228 - "dev": true, 2229 - "license": "MIT", 2230 - "dependencies": { 2231 - "flat-cache": "^4.0.0" 2232 - }, 2233 - "engines": { 2234 - "node": ">=16.0.0" 2235 - } 2236 - }, 2237 - "node_modules/finalhandler": { 2238 - "version": "2.1.0", 2239 - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", 2240 - "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", 2241 - "dev": true, 2242 - "license": "MIT", 2243 - "dependencies": { 2244 - "debug": "^4.4.0", 2245 - "encodeurl": "^2.0.0", 2246 - "escape-html": "^1.0.3", 2247 - "on-finished": "^2.4.1", 2248 - "parseurl": "^1.3.3", 2249 - "statuses": "^2.0.1" 2250 - }, 2251 - "engines": { 2252 - "node": ">= 0.8" 2253 - } 2254 - }, 2255 - "node_modules/find-up": { 2256 - "version": "5.0.0", 2257 - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 2258 - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 2259 - "dev": true, 2260 - "license": "MIT", 2261 - "dependencies": { 2262 - "locate-path": "^6.0.0", 2263 - "path-exists": "^4.0.0" 2264 - }, 2265 - "engines": { 2266 - "node": ">=10" 2267 - }, 2268 - "funding": { 2269 - "url": "https://github.com/sponsors/sindresorhus" 2270 - } 2271 - }, 2272 - "node_modules/flat-cache": { 2273 - "version": "4.0.1", 2274 - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", 2275 - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", 2276 - "dev": true, 2277 - "license": "MIT", 2278 - "dependencies": { 2279 - "flatted": "^3.2.9", 2280 - "keyv": "^4.5.4" 2281 - }, 2282 - "engines": { 2283 - "node": ">=16" 2284 - } 2285 - }, 2286 - "node_modules/flatted": { 2287 - "version": "3.3.3", 2288 - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", 2289 - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", 2290 - "dev": true, 2291 - "license": "ISC" 2292 - }, 2293 - "node_modules/forwarded": { 2294 - "version": "0.2.0", 2295 - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 2296 - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 2297 - "dev": true, 2298 - "license": "MIT", 2299 - "engines": { 2300 - "node": ">= 0.6" 2301 - } 2302 - }, 2303 - "node_modules/fresh": { 2304 - "version": "2.0.0", 2305 - "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", 2306 - "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", 2307 - "dev": true, 2308 - "license": "MIT", 2309 - "engines": { 2310 - "node": ">= 0.8" 2311 - } 2312 - }, 2313 1428 "node_modules/fsevents": { 2314 1429 "version": "2.3.3", 2315 1430 "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", ··· 2325 1440 "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 2326 1441 } 2327 1442 }, 2328 - "node_modules/function-bind": { 2329 - "version": "1.1.2", 2330 - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 2331 - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 2332 - "dev": true, 2333 - "license": "MIT", 2334 - "funding": { 2335 - "url": "https://github.com/sponsors/ljharb" 2336 - } 2337 - }, 2338 - "node_modules/get-intrinsic": { 2339 - "version": "1.3.0", 2340 - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", 2341 - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", 2342 - "dev": true, 2343 - "license": "MIT", 2344 - "dependencies": { 2345 - "call-bind-apply-helpers": "^1.0.2", 2346 - "es-define-property": "^1.0.1", 2347 - "es-errors": "^1.3.0", 2348 - "es-object-atoms": "^1.1.1", 2349 - "function-bind": "^1.1.2", 2350 - "get-proto": "^1.0.1", 2351 - "gopd": "^1.2.0", 2352 - "has-symbols": "^1.1.0", 2353 - "hasown": "^2.0.2", 2354 - "math-intrinsics": "^1.1.0" 2355 - }, 2356 - "engines": { 2357 - "node": ">= 0.4" 2358 - }, 2359 - "funding": { 2360 - "url": "https://github.com/sponsors/ljharb" 2361 - } 2362 - }, 2363 - "node_modules/get-proto": { 2364 - "version": "1.0.1", 2365 - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", 2366 - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", 2367 - "dev": true, 2368 - "license": "MIT", 2369 - "dependencies": { 2370 - "dunder-proto": "^1.0.1", 2371 - "es-object-atoms": "^1.0.0" 2372 - }, 2373 - "engines": { 2374 - "node": ">= 0.4" 2375 - } 2376 - }, 2377 - "node_modules/glob-parent": { 2378 - "version": "6.0.2", 2379 - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", 2380 - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", 2381 - "dev": true, 2382 - "license": "ISC", 2383 - "dependencies": { 2384 - "is-glob": "^4.0.3" 2385 - }, 2386 - "engines": { 2387 - "node": ">=10.13.0" 2388 - } 2389 - }, 2390 1443 "node_modules/glob-to-regexp": { 2391 1444 "version": "0.4.1", 2392 1445 "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", ··· 2394 1447 "dev": true, 2395 1448 "license": "BSD-2-Clause" 2396 1449 }, 2397 - "node_modules/globals": { 2398 - "version": "16.1.0", 2399 - "resolved": "https://registry.npmjs.org/globals/-/globals-16.1.0.tgz", 2400 - "integrity": "sha512-aibexHNbb/jiUSObBgpHLj+sIuUmJnYcgXBlrfsiDZ9rt4aF2TFRbyLgZ2iFQuVZ1K5Mx3FVkbKRSgKrbK3K2g==", 2401 - "dev": true, 2402 - "license": "MIT", 2403 - "engines": { 2404 - "node": ">=18" 2405 - }, 2406 - "funding": { 2407 - "url": "https://github.com/sponsors/sindresorhus" 2408 - } 2409 - }, 2410 - "node_modules/gopd": { 2411 - "version": "1.2.0", 2412 - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", 2413 - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", 2414 - "dev": true, 2415 - "license": "MIT", 2416 - "engines": { 2417 - "node": ">= 0.4" 2418 - }, 2419 - "funding": { 2420 - "url": "https://github.com/sponsors/ljharb" 2421 - } 2422 - }, 2423 - "node_modules/has-flag": { 2424 - "version": "4.0.0", 2425 - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 2426 - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 2427 - "dev": true, 2428 - "license": "MIT", 2429 - "engines": { 2430 - "node": ">=8" 2431 - } 2432 - }, 2433 - "node_modules/has-symbols": { 2434 - "version": "1.1.0", 2435 - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", 2436 - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", 2437 - "dev": true, 2438 - "license": "MIT", 2439 - "engines": { 2440 - "node": ">= 0.4" 2441 - }, 2442 - "funding": { 2443 - "url": "https://github.com/sponsors/ljharb" 2444 - } 2445 - }, 2446 - "node_modules/hasown": { 2447 - "version": "2.0.2", 2448 - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 2449 - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 2450 - "dev": true, 2451 - "license": "MIT", 2452 - "dependencies": { 2453 - "function-bind": "^1.1.2" 2454 - }, 2455 - "engines": { 2456 - "node": ">= 0.4" 2457 - } 2458 - }, 2459 1450 "node_modules/html-minifier-terser": { 2460 1451 "version": "7.2.0", 2461 1452 "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", ··· 2478 1469 "node": "^14.13.1 || >=16.0.0" 2479 1470 } 2480 1471 }, 2481 - "node_modules/http-errors": { 2482 - "version": "2.0.0", 2483 - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 2484 - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 2485 - "dev": true, 2486 - "license": "MIT", 2487 - "dependencies": { 2488 - "depd": "2.0.0", 2489 - "inherits": "2.0.4", 2490 - "setprototypeof": "1.2.0", 2491 - "statuses": "2.0.1", 2492 - "toidentifier": "1.0.1" 2493 - }, 2494 - "engines": { 2495 - "node": ">= 0.8" 2496 - } 2497 - }, 2498 - "node_modules/iconv-lite": { 2499 - "version": "0.6.3", 2500 - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 2501 - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 2502 - "dev": true, 2503 - "license": "MIT", 2504 - "dependencies": { 2505 - "safer-buffer": ">= 2.1.2 < 3.0.0" 2506 - }, 2507 - "engines": { 2508 - "node": ">=0.10.0" 2509 - } 2510 - }, 2511 - "node_modules/ignore": { 2512 - "version": "5.3.2", 2513 - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", 2514 - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", 2515 - "dev": true, 2516 - "license": "MIT", 2517 - "engines": { 2518 - "node": ">= 4" 2519 - } 2520 - }, 2521 - "node_modules/import-fresh": { 2522 - "version": "3.3.1", 2523 - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", 2524 - "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", 2525 - "dev": true, 2526 - "license": "MIT", 2527 - "dependencies": { 2528 - "parent-module": "^1.0.0", 2529 - "resolve-from": "^4.0.0" 2530 - }, 2531 - "engines": { 2532 - "node": ">=6" 2533 - }, 2534 - "funding": { 2535 - "url": "https://github.com/sponsors/sindresorhus" 2536 - } 2537 - }, 2538 - "node_modules/imurmurhash": { 2539 - "version": "0.1.4", 2540 - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 2541 - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 2542 - "dev": true, 2543 - "license": "MIT", 2544 - "engines": { 2545 - "node": ">=0.8.19" 2546 - } 2547 - }, 2548 - "node_modules/inherits": { 2549 - "version": "2.0.4", 2550 - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 2551 - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 2552 - "dev": true, 2553 - "license": "ISC" 2554 - }, 2555 - "node_modules/ipaddr.js": { 2556 - "version": "1.9.1", 2557 - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 2558 - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 2559 - "dev": true, 2560 - "license": "MIT", 2561 - "engines": { 2562 - "node": ">= 0.10" 2563 - } 2564 - }, 2565 1472 "node_modules/is-arrayish": { 2566 1473 "version": "0.3.4", 2567 1474 "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", ··· 2569 1476 "dev": true, 2570 1477 "license": "MIT" 2571 1478 }, 2572 - "node_modules/is-extglob": { 2573 - "version": "2.1.1", 2574 - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 2575 - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 2576 - "dev": true, 2577 - "license": "MIT", 2578 - "engines": { 2579 - "node": ">=0.10.0" 2580 - } 2581 - }, 2582 - "node_modules/is-glob": { 2583 - "version": "4.0.3", 2584 - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 2585 - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 2586 - "dev": true, 2587 - "license": "MIT", 2588 - "dependencies": { 2589 - "is-extglob": "^2.1.1" 2590 - }, 2591 - "engines": { 2592 - "node": ">=0.10.0" 2593 - } 2594 - }, 2595 - "node_modules/is-promise": { 2596 - "version": "4.0.0", 2597 - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", 2598 - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", 2599 - "dev": true, 2600 - "license": "MIT" 2601 - }, 2602 - "node_modules/isexe": { 2603 - "version": "2.0.0", 2604 - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 2605 - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 2606 - "dev": true, 2607 - "license": "ISC" 2608 - }, 2609 - "node_modules/js-yaml": { 2610 - "version": "4.1.0", 2611 - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 2612 - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 2613 - "dev": true, 2614 - "license": "MIT", 2615 - "dependencies": { 2616 - "argparse": "^2.0.1" 2617 - }, 2618 - "bin": { 2619 - "js-yaml": "bin/js-yaml.js" 2620 - } 2621 - }, 2622 - "node_modules/json-buffer": { 2623 - "version": "3.0.1", 2624 - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", 2625 - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", 2626 - "dev": true, 2627 - "license": "MIT" 2628 - }, 2629 - "node_modules/json-schema-traverse": { 2630 - "version": "0.4.1", 2631 - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 2632 - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 2633 - "dev": true, 2634 - "license": "MIT" 2635 - }, 2636 - "node_modules/json-stable-stringify-without-jsonify": { 2637 - "version": "1.0.1", 2638 - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 2639 - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 2640 - "dev": true, 2641 - "license": "MIT" 2642 - }, 2643 - "node_modules/keyv": { 2644 - "version": "4.5.4", 2645 - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", 2646 - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", 2647 - "dev": true, 2648 - "license": "MIT", 2649 - "dependencies": { 2650 - "json-buffer": "3.0.1" 2651 - } 2652 - }, 2653 1479 "node_modules/kleur": { 2654 1480 "version": "4.1.5", 2655 1481 "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", ··· 2660 1486 "node": ">=6" 2661 1487 } 2662 1488 }, 2663 - "node_modules/levn": { 2664 - "version": "0.4.1", 2665 - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", 2666 - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 2667 - "dev": true, 2668 - "license": "MIT", 2669 - "dependencies": { 2670 - "prelude-ls": "^1.2.1", 2671 - "type-check": "~0.4.0" 2672 - }, 2673 - "engines": { 2674 - "node": ">= 0.8.0" 2675 - } 2676 - }, 2677 - "node_modules/locate-path": { 2678 - "version": "6.0.0", 2679 - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 2680 - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 2681 - "dev": true, 2682 - "license": "MIT", 2683 - "dependencies": { 2684 - "p-locate": "^5.0.0" 2685 - }, 2686 - "engines": { 2687 - "node": ">=10" 2688 - }, 2689 - "funding": { 2690 - "url": "https://github.com/sponsors/sindresorhus" 2691 - } 2692 - }, 2693 - "node_modules/lodash.merge": { 2694 - "version": "4.6.2", 2695 - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", 2696 - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", 2697 - "dev": true, 2698 - "license": "MIT" 2699 - }, 2700 1489 "node_modules/lower-case": { 2701 1490 "version": "2.0.2", 2702 1491 "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", ··· 2707 1496 "tslib": "^2.0.3" 2708 1497 } 2709 1498 }, 2710 - "node_modules/math-intrinsics": { 2711 - "version": "1.1.0", 2712 - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", 2713 - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", 2714 - "dev": true, 2715 - "license": "MIT", 2716 - "engines": { 2717 - "node": ">= 0.4" 2718 - } 2719 - }, 2720 - "node_modules/media-typer": { 2721 - "version": "1.1.0", 2722 - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", 2723 - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", 2724 - "dev": true, 2725 - "license": "MIT", 2726 - "engines": { 2727 - "node": ">= 0.8" 2728 - } 2729 - }, 2730 - "node_modules/merge-descriptors": { 2731 - "version": "2.0.0", 2732 - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", 2733 - "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", 2734 - "dev": true, 2735 - "license": "MIT", 2736 - "engines": { 2737 - "node": ">=18" 2738 - }, 2739 - "funding": { 2740 - "url": "https://github.com/sponsors/sindresorhus" 2741 - } 2742 - }, 2743 1499 "node_modules/mime": { 2744 1500 "version": "3.0.0", 2745 1501 "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", ··· 2753 1509 "node": ">=10.0.0" 2754 1510 } 2755 1511 }, 2756 - "node_modules/mime-db": { 2757 - "version": "1.54.0", 2758 - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", 2759 - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", 2760 - "dev": true, 2761 - "license": "MIT", 2762 - "engines": { 2763 - "node": ">= 0.6" 2764 - } 2765 - }, 2766 - "node_modules/mime-types": { 2767 - "version": "3.0.1", 2768 - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", 2769 - "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", 2770 - "dev": true, 2771 - "license": "MIT", 2772 - "dependencies": { 2773 - "mime-db": "^1.54.0" 2774 - }, 2775 - "engines": { 2776 - "node": ">= 0.6" 2777 - } 2778 - }, 2779 1512 "node_modules/miniflare": { 2780 1513 "version": "4.20251210.0", 2781 1514 "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20251210.0.tgz", ··· 2826 1559 "url": "https://github.com/sponsors/colinhacks" 2827 1560 } 2828 1561 }, 2829 - "node_modules/minimatch": { 2830 - "version": "3.1.2", 2831 - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 2832 - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 2833 - "dev": true, 2834 - "license": "ISC", 2835 - "dependencies": { 2836 - "brace-expansion": "^1.1.7" 2837 - }, 2838 - "engines": { 2839 - "node": "*" 2840 - } 2841 - }, 2842 - "node_modules/ms": { 2843 - "version": "2.1.3", 2844 - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 2845 - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 2846 - "dev": true, 2847 - "license": "MIT" 2848 - }, 2849 - "node_modules/natural-compare": { 2850 - "version": "1.4.0", 2851 - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 2852 - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 2853 - "dev": true, 2854 - "license": "MIT" 2855 - }, 2856 - "node_modules/negotiator": { 2857 - "version": "1.0.0", 2858 - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", 2859 - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", 2860 - "dev": true, 2861 - "license": "MIT", 2862 - "engines": { 2863 - "node": ">= 0.6" 2864 - } 2865 - }, 2866 1562 "node_modules/no-case": { 2867 1563 "version": "3.0.4", 2868 1564 "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", ··· 2874 1570 "tslib": "^2.0.3" 2875 1571 } 2876 1572 }, 2877 - "node_modules/object-assign": { 2878 - "version": "4.1.1", 2879 - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 2880 - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 2881 - "dev": true, 2882 - "license": "MIT", 2883 - "engines": { 2884 - "node": ">=0.10.0" 2885 - } 2886 - }, 2887 - "node_modules/object-inspect": { 2888 - "version": "1.13.4", 2889 - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", 2890 - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", 2891 - "dev": true, 2892 - "license": "MIT", 2893 - "engines": { 2894 - "node": ">= 0.4" 2895 - }, 2896 - "funding": { 2897 - "url": "https://github.com/sponsors/ljharb" 2898 - } 2899 - }, 2900 - "node_modules/on-finished": { 2901 - "version": "2.4.1", 2902 - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 2903 - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 1573 + "node_modules/oxfmt": { 1574 + "version": "0.24.0", 1575 + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.24.0.tgz", 1576 + "integrity": "sha512-UjeM3Peez8Tl7IJ9s5UwAoZSiDRMww7BEc21gDYxLq3S3/KqJnM3mjNxsoSHgmBvSeX6RBhoVc2MfC/+96RdSw==", 2904 1577 "dev": true, 2905 1578 "license": "MIT", 2906 1579 "dependencies": { 2907 - "ee-first": "1.1.1" 1580 + "tinypool": "2.0.0" 2908 1581 }, 2909 - "engines": { 2910 - "node": ">= 0.8" 2911 - } 2912 - }, 2913 - "node_modules/once": { 2914 - "version": "1.4.0", 2915 - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 2916 - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 2917 - "dev": true, 2918 - "license": "ISC", 2919 - "dependencies": { 2920 - "wrappy": "1" 2921 - } 2922 - }, 2923 - "node_modules/optionator": { 2924 - "version": "0.9.4", 2925 - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", 2926 - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", 2927 - "dev": true, 2928 - "license": "MIT", 2929 - "dependencies": { 2930 - "deep-is": "^0.1.3", 2931 - "fast-levenshtein": "^2.0.6", 2932 - "levn": "^0.4.1", 2933 - "prelude-ls": "^1.2.1", 2934 - "type-check": "^0.4.0", 2935 - "word-wrap": "^1.2.5" 1582 + "bin": { 1583 + "oxfmt": "bin/oxfmt" 2936 1584 }, 2937 1585 "engines": { 2938 - "node": ">= 0.8.0" 2939 - } 2940 - }, 2941 - "node_modules/p-limit": { 2942 - "version": "3.1.0", 2943 - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 2944 - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 2945 - "dev": true, 2946 - "license": "MIT", 2947 - "dependencies": { 2948 - "yocto-queue": "^0.1.0" 2949 - }, 2950 - "engines": { 2951 - "node": ">=10" 1586 + "node": "^20.19.0 || >=22.12.0" 2952 1587 }, 2953 1588 "funding": { 2954 - "url": "https://github.com/sponsors/sindresorhus" 2955 - } 2956 - }, 2957 - "node_modules/p-locate": { 2958 - "version": "5.0.0", 2959 - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 2960 - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 2961 - "dev": true, 2962 - "license": "MIT", 2963 - "dependencies": { 2964 - "p-limit": "^3.0.2" 1589 + "url": "https://github.com/sponsors/Boshen" 2965 1590 }, 2966 - "engines": { 2967 - "node": ">=10" 2968 - }, 2969 - "funding": { 2970 - "url": "https://github.com/sponsors/sindresorhus" 1591 + "optionalDependencies": { 1592 + "@oxfmt/darwin-arm64": "0.24.0", 1593 + "@oxfmt/darwin-x64": "0.24.0", 1594 + "@oxfmt/linux-arm64-gnu": "0.24.0", 1595 + "@oxfmt/linux-arm64-musl": "0.24.0", 1596 + "@oxfmt/linux-x64-gnu": "0.24.0", 1597 + "@oxfmt/linux-x64-musl": "0.24.0", 1598 + "@oxfmt/win32-arm64": "0.24.0", 1599 + "@oxfmt/win32-x64": "0.24.0" 2971 1600 } 2972 1601 }, 2973 1602 "node_modules/param-case": { ··· 2981 1610 "tslib": "^2.0.3" 2982 1611 } 2983 1612 }, 2984 - "node_modules/parent-module": { 2985 - "version": "1.0.1", 2986 - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 2987 - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 2988 - "dev": true, 2989 - "license": "MIT", 2990 - "dependencies": { 2991 - "callsites": "^3.0.0" 2992 - }, 2993 - "engines": { 2994 - "node": ">=6" 2995 - } 2996 - }, 2997 - "node_modules/parseurl": { 2998 - "version": "1.3.3", 2999 - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 3000 - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 3001 - "dev": true, 3002 - "license": "MIT", 3003 - "engines": { 3004 - "node": ">= 0.8" 3005 - } 3006 - }, 3007 1613 "node_modules/pascal-case": { 3008 1614 "version": "3.1.2", 3009 1615 "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", ··· 3015 1621 "tslib": "^2.0.3" 3016 1622 } 3017 1623 }, 3018 - "node_modules/path-exists": { 3019 - "version": "4.0.0", 3020 - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 3021 - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 3022 - "dev": true, 3023 - "license": "MIT", 3024 - "engines": { 3025 - "node": ">=8" 3026 - } 3027 - }, 3028 - "node_modules/path-key": { 3029 - "version": "3.1.1", 3030 - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 3031 - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 3032 - "dev": true, 3033 - "license": "MIT", 3034 - "engines": { 3035 - "node": ">=8" 3036 - } 3037 - }, 3038 - "node_modules/path-to-regexp": { 3039 - "version": "8.2.0", 3040 - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", 3041 - "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", 3042 - "dev": true, 3043 - "license": "MIT", 3044 - "engines": { 3045 - "node": ">=16" 3046 - } 3047 - }, 3048 1624 "node_modules/pathe": { 3049 1625 "version": "2.0.3", 3050 1626 "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", ··· 3052 1628 "dev": true, 3053 1629 "license": "MIT" 3054 1630 }, 3055 - "node_modules/pkce-challenge": { 3056 - "version": "5.0.0", 3057 - "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz", 3058 - "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==", 3059 - "dev": true, 3060 - "license": "MIT", 3061 - "engines": { 3062 - "node": ">=16.20.0" 3063 - } 3064 - }, 3065 - "node_modules/prelude-ls": { 3066 - "version": "1.2.1", 3067 - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 3068 - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 3069 - "dev": true, 3070 - "license": "MIT", 3071 - "engines": { 3072 - "node": ">= 0.8.0" 3073 - } 3074 - }, 3075 - "node_modules/prettier": { 3076 - "version": "3.5.3", 3077 - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", 3078 - "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", 3079 - "dev": true, 3080 - "license": "MIT", 3081 - "bin": { 3082 - "prettier": "bin/prettier.cjs" 3083 - }, 3084 - "engines": { 3085 - "node": ">=14" 3086 - }, 3087 - "funding": { 3088 - "url": "https://github.com/prettier/prettier?sponsor=1" 3089 - } 3090 - }, 3091 - "node_modules/proxy-addr": { 3092 - "version": "2.0.7", 3093 - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 3094 - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 3095 - "dev": true, 3096 - "license": "MIT", 3097 - "dependencies": { 3098 - "forwarded": "0.2.0", 3099 - "ipaddr.js": "1.9.1" 3100 - }, 3101 - "engines": { 3102 - "node": ">= 0.10" 3103 - } 3104 - }, 3105 - "node_modules/punycode": { 3106 - "version": "2.3.1", 3107 - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", 3108 - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", 3109 - "dev": true, 3110 - "license": "MIT", 3111 - "engines": { 3112 - "node": ">=6" 3113 - } 3114 - }, 3115 - "node_modules/qs": { 3116 - "version": "6.14.0", 3117 - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", 3118 - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", 3119 - "dev": true, 3120 - "license": "BSD-3-Clause", 3121 - "dependencies": { 3122 - "side-channel": "^1.1.0" 3123 - }, 3124 - "engines": { 3125 - "node": ">=0.6" 3126 - }, 3127 - "funding": { 3128 - "url": "https://github.com/sponsors/ljharb" 3129 - } 3130 - }, 3131 - "node_modules/range-parser": { 3132 - "version": "1.2.1", 3133 - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 3134 - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 3135 - "dev": true, 3136 - "license": "MIT", 3137 - "engines": { 3138 - "node": ">= 0.6" 3139 - } 3140 - }, 3141 - "node_modules/raw-body": { 3142 - "version": "3.0.0", 3143 - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", 3144 - "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", 3145 - "dev": true, 3146 - "license": "MIT", 3147 - "dependencies": { 3148 - "bytes": "3.1.2", 3149 - "http-errors": "2.0.0", 3150 - "iconv-lite": "0.6.3", 3151 - "unpipe": "1.0.0" 3152 - }, 3153 - "engines": { 3154 - "node": ">= 0.8" 3155 - } 3156 - }, 3157 1631 "node_modules/relateurl": { 3158 1632 "version": "0.2.7", 3159 1633 "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", ··· 3164 1638 "node": ">= 0.10" 3165 1639 } 3166 1640 }, 3167 - "node_modules/resolve-from": { 3168 - "version": "4.0.0", 3169 - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 3170 - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 3171 - "dev": true, 3172 - "license": "MIT", 3173 - "engines": { 3174 - "node": ">=4" 3175 - } 3176 - }, 3177 - "node_modules/router": { 3178 - "version": "2.2.0", 3179 - "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", 3180 - "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", 3181 - "dev": true, 3182 - "license": "MIT", 3183 - "dependencies": { 3184 - "debug": "^4.4.0", 3185 - "depd": "^2.0.0", 3186 - "is-promise": "^4.0.0", 3187 - "parseurl": "^1.3.3", 3188 - "path-to-regexp": "^8.0.0" 3189 - }, 3190 - "engines": { 3191 - "node": ">= 18" 3192 - } 3193 - }, 3194 - "node_modules/safe-buffer": { 3195 - "version": "5.2.1", 3196 - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 3197 - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 3198 - "dev": true, 3199 - "funding": [ 3200 - { 3201 - "type": "github", 3202 - "url": "https://github.com/sponsors/feross" 3203 - }, 3204 - { 3205 - "type": "patreon", 3206 - "url": "https://www.patreon.com/feross" 3207 - }, 3208 - { 3209 - "type": "consulting", 3210 - "url": "https://feross.org/support" 3211 - } 3212 - ], 3213 - "license": "MIT" 3214 - }, 3215 - "node_modules/safer-buffer": { 3216 - "version": "2.1.2", 3217 - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 3218 - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 3219 - "dev": true, 3220 - "license": "MIT" 3221 - }, 3222 1641 "node_modules/semver": { 3223 1642 "version": "7.7.3", 3224 1643 "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", ··· 3232 1651 "node": ">=10" 3233 1652 } 3234 1653 }, 3235 - "node_modules/send": { 3236 - "version": "1.2.0", 3237 - "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", 3238 - "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", 3239 - "dev": true, 3240 - "license": "MIT", 3241 - "dependencies": { 3242 - "debug": "^4.3.5", 3243 - "encodeurl": "^2.0.0", 3244 - "escape-html": "^1.0.3", 3245 - "etag": "^1.8.1", 3246 - "fresh": "^2.0.0", 3247 - "http-errors": "^2.0.0", 3248 - "mime-types": "^3.0.1", 3249 - "ms": "^2.1.3", 3250 - "on-finished": "^2.4.1", 3251 - "range-parser": "^1.2.1", 3252 - "statuses": "^2.0.1" 3253 - }, 3254 - "engines": { 3255 - "node": ">= 18" 3256 - } 3257 - }, 3258 - "node_modules/serve-static": { 3259 - "version": "2.2.0", 3260 - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", 3261 - "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", 3262 - "dev": true, 3263 - "license": "MIT", 3264 - "dependencies": { 3265 - "encodeurl": "^2.0.0", 3266 - "escape-html": "^1.0.3", 3267 - "parseurl": "^1.3.3", 3268 - "send": "^1.2.0" 3269 - }, 3270 - "engines": { 3271 - "node": ">= 18" 3272 - } 3273 - }, 3274 - "node_modules/setprototypeof": { 3275 - "version": "1.2.0", 3276 - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 3277 - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", 3278 - "dev": true, 3279 - "license": "ISC" 3280 - }, 3281 1654 "node_modules/sharp": { 3282 1655 "version": "0.33.5", 3283 1656 "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", ··· 3318 1691 "@img/sharp-win32-x64": "0.33.5" 3319 1692 } 3320 1693 }, 3321 - "node_modules/shebang-command": { 3322 - "version": "2.0.0", 3323 - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 3324 - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 3325 - "dev": true, 3326 - "license": "MIT", 3327 - "dependencies": { 3328 - "shebang-regex": "^3.0.0" 3329 - }, 3330 - "engines": { 3331 - "node": ">=8" 3332 - } 3333 - }, 3334 - "node_modules/shebang-regex": { 3335 - "version": "3.0.0", 3336 - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 3337 - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 3338 - "dev": true, 3339 - "license": "MIT", 3340 - "engines": { 3341 - "node": ">=8" 3342 - } 3343 - }, 3344 - "node_modules/side-channel": { 3345 - "version": "1.1.0", 3346 - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", 3347 - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", 3348 - "dev": true, 3349 - "license": "MIT", 3350 - "dependencies": { 3351 - "es-errors": "^1.3.0", 3352 - "object-inspect": "^1.13.3", 3353 - "side-channel-list": "^1.0.0", 3354 - "side-channel-map": "^1.0.1", 3355 - "side-channel-weakmap": "^1.0.2" 3356 - }, 3357 - "engines": { 3358 - "node": ">= 0.4" 3359 - }, 3360 - "funding": { 3361 - "url": "https://github.com/sponsors/ljharb" 3362 - } 3363 - }, 3364 - "node_modules/side-channel-list": { 3365 - "version": "1.0.0", 3366 - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", 3367 - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", 3368 - "dev": true, 3369 - "license": "MIT", 3370 - "dependencies": { 3371 - "es-errors": "^1.3.0", 3372 - "object-inspect": "^1.13.3" 3373 - }, 3374 - "engines": { 3375 - "node": ">= 0.4" 3376 - }, 3377 - "funding": { 3378 - "url": "https://github.com/sponsors/ljharb" 3379 - } 3380 - }, 3381 - "node_modules/side-channel-map": { 3382 - "version": "1.0.1", 3383 - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", 3384 - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", 3385 - "dev": true, 3386 - "license": "MIT", 3387 - "dependencies": { 3388 - "call-bound": "^1.0.2", 3389 - "es-errors": "^1.3.0", 3390 - "get-intrinsic": "^1.2.5", 3391 - "object-inspect": "^1.13.3" 3392 - }, 3393 - "engines": { 3394 - "node": ">= 0.4" 3395 - }, 3396 - "funding": { 3397 - "url": "https://github.com/sponsors/ljharb" 3398 - } 3399 - }, 3400 - "node_modules/side-channel-weakmap": { 3401 - "version": "1.0.2", 3402 - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", 3403 - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", 3404 - "dev": true, 3405 - "license": "MIT", 3406 - "dependencies": { 3407 - "call-bound": "^1.0.2", 3408 - "es-errors": "^1.3.0", 3409 - "get-intrinsic": "^1.2.5", 3410 - "object-inspect": "^1.13.3", 3411 - "side-channel-map": "^1.0.1" 3412 - }, 3413 - "engines": { 3414 - "node": ">= 0.4" 3415 - }, 3416 - "funding": { 3417 - "url": "https://github.com/sponsors/ljharb" 3418 - } 3419 - }, 3420 1694 "node_modules/simple-swizzle": { 3421 1695 "version": "0.2.4", 3422 1696 "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", ··· 3448 1722 "source-map": "^0.6.0" 3449 1723 } 3450 1724 }, 3451 - "node_modules/statuses": { 3452 - "version": "2.0.1", 3453 - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 3454 - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 3455 - "dev": true, 3456 - "license": "MIT", 3457 - "engines": { 3458 - "node": ">= 0.8" 3459 - } 3460 - }, 3461 1725 "node_modules/stoppable": { 3462 1726 "version": "1.1.0", 3463 1727 "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", ··· 3469 1733 "npm": ">=6" 3470 1734 } 3471 1735 }, 3472 - "node_modules/strip-json-comments": { 3473 - "version": "3.1.1", 3474 - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 3475 - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 3476 - "dev": true, 3477 - "license": "MIT", 3478 - "engines": { 3479 - "node": ">=8" 3480 - }, 3481 - "funding": { 3482 - "url": "https://github.com/sponsors/sindresorhus" 3483 - } 3484 - }, 3485 - "node_modules/supports-color": { 3486 - "version": "7.2.0", 3487 - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 3488 - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 3489 - "dev": true, 3490 - "license": "MIT", 3491 - "dependencies": { 3492 - "has-flag": "^4.0.0" 3493 - }, 3494 - "engines": { 3495 - "node": ">=8" 3496 - } 3497 - }, 3498 1736 "node_modules/terser": { 3499 1737 "version": "5.44.1", 3500 1738 "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", ··· 3521 1759 "dev": true, 3522 1760 "license": "MIT" 3523 1761 }, 3524 - "node_modules/toidentifier": { 3525 - "version": "1.0.1", 3526 - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 3527 - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1762 + "node_modules/tinypool": { 1763 + "version": "2.0.0", 1764 + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.0.0.tgz", 1765 + "integrity": "sha512-/RX9RzeH2xU5ADE7n2Ykvmi9ED3FBGPAjw9u3zucrNNaEBIO0HPSYgL0NT7+3p147ojeSdaVu08F6hjpv31HJg==", 3528 1766 "dev": true, 3529 1767 "license": "MIT", 3530 1768 "engines": { 3531 - "node": ">=0.6" 1769 + "node": "^20.0.0 || >=22.0.0" 3532 1770 } 3533 1771 }, 3534 1772 "node_modules/tslib": { ··· 3538 1776 "dev": true, 3539 1777 "license": "0BSD" 3540 1778 }, 3541 - "node_modules/type-check": { 3542 - "version": "0.4.0", 3543 - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", 3544 - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 3545 - "dev": true, 3546 - "license": "MIT", 3547 - "dependencies": { 3548 - "prelude-ls": "^1.2.1" 3549 - }, 3550 - "engines": { 3551 - "node": ">= 0.8.0" 3552 - } 3553 - }, 3554 - "node_modules/type-is": { 3555 - "version": "2.0.1", 3556 - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", 3557 - "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", 3558 - "dev": true, 3559 - "license": "MIT", 3560 - "dependencies": { 3561 - "content-type": "^1.0.5", 3562 - "media-typer": "^1.1.0", 3563 - "mime-types": "^3.0.0" 3564 - }, 3565 - "engines": { 3566 - "node": ">= 0.6" 3567 - } 3568 - }, 3569 1779 "node_modules/undici": { 3570 1780 "version": "7.14.0", 3571 1781 "resolved": "https://registry.npmjs.org/undici/-/undici-7.14.0.tgz", ··· 3587 1797 "pathe": "^2.0.3" 3588 1798 } 3589 1799 }, 3590 - "node_modules/unpipe": { 3591 - "version": "1.0.0", 3592 - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 3593 - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 3594 - "dev": true, 3595 - "license": "MIT", 3596 - "engines": { 3597 - "node": ">= 0.8" 3598 - } 3599 - }, 3600 - "node_modules/uri-js": { 3601 - "version": "4.4.1", 3602 - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 3603 - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 3604 - "dev": true, 3605 - "license": "BSD-2-Clause", 3606 - "dependencies": { 3607 - "punycode": "^2.1.0" 3608 - } 3609 - }, 3610 - "node_modules/vary": { 3611 - "version": "1.1.2", 3612 - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 3613 - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 3614 - "dev": true, 3615 - "license": "MIT", 3616 - "engines": { 3617 - "node": ">= 0.8" 3618 - } 3619 - }, 3620 - "node_modules/which": { 3621 - "version": "2.0.2", 3622 - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 3623 - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 3624 - "dev": true, 3625 - "license": "ISC", 3626 - "dependencies": { 3627 - "isexe": "^2.0.0" 3628 - }, 3629 - "bin": { 3630 - "node-which": "bin/node-which" 3631 - }, 3632 - "engines": { 3633 - "node": ">= 8" 3634 - } 3635 - }, 3636 - "node_modules/word-wrap": { 3637 - "version": "1.2.5", 3638 - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", 3639 - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", 3640 - "dev": true, 3641 - "license": "MIT", 3642 - "engines": { 3643 - "node": ">=0.10.0" 3644 - } 3645 - }, 3646 1800 "node_modules/workerd": { 3647 1801 "version": "1.20251210.0", 3648 1802 "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20251210.0.tgz", ··· 3707 1861 "dev": true, 3708 1862 "license": "MIT" 3709 1863 }, 3710 - "node_modules/wrappy": { 3711 - "version": "1.0.2", 3712 - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 3713 - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 3714 - "dev": true, 3715 - "license": "ISC" 3716 - }, 3717 1864 "node_modules/ws": { 3718 1865 "version": "8.18.0", 3719 1866 "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", ··· 3736 1883 } 3737 1884 } 3738 1885 }, 3739 - "node_modules/yocto-queue": { 3740 - "version": "0.1.0", 3741 - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 3742 - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 3743 - "dev": true, 3744 - "license": "MIT", 3745 - "engines": { 3746 - "node": ">=10" 3747 - }, 3748 - "funding": { 3749 - "url": "https://github.com/sponsors/sindresorhus" 3750 - } 3751 - }, 3752 1886 "node_modules/youch": { 3753 1887 "version": "4.1.0-beta.10", 3754 1888 "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", ··· 3786 1920 "funding": { 3787 1921 "type": "opencollective", 3788 1922 "url": "https://opencollective.com/express" 3789 - } 3790 - }, 3791 - "node_modules/zod": { 3792 - "version": "3.24.4", 3793 - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.4.tgz", 3794 - "integrity": "sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==", 3795 - "dev": true, 3796 - "license": "MIT", 3797 - "peer": true, 3798 - "funding": { 3799 - "url": "https://github.com/sponsors/colinhacks" 3800 - } 3801 - }, 3802 - "node_modules/zod-to-json-schema": { 3803 - "version": "3.24.5", 3804 - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz", 3805 - "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==", 3806 - "dev": true, 3807 - "license": "ISC", 3808 - "peerDependencies": { 3809 - "zod": "^3.24.1" 3810 1923 } 3811 1924 } 3812 1925 }
+8 -15
package.json
··· 2 2 "name": "pvz", 3 3 "version": "1.0.0", 4 4 "description": "", 5 - "scripts": { 6 - "build": "node scripts/build.mjs", 7 - "lint": "eslint .", 8 - "fix": "eslint . --fix", 9 - "deploy": "npm run build && wrangler deploy" 10 - }, 11 5 "keywords": [], 6 + "license": "CC-BY-NC-ND-4.0", 12 7 "author": "", 13 - "license": "CC-BY-NC-ND-4.0", 14 - "packageManager": "pnpm@10.10.0", 8 + "scripts": { 9 + "lint": "oxlint", 10 + "fix": "oxlint --fix" 11 + }, 15 12 "devDependencies": { 16 - "@eslint/js": "^9.26.0", 17 - "clean-css": "^5.3.3", 18 - "eslint": "^9.26.0", 19 - "eslint-plugin-eqeqeq-fix": "^1.0.3", 20 - "globals": "^16.0.0", 21 13 "html-minifier-terser": "^7.2.0", 22 - "prettier": "^3.5.3", 14 + "oxfmt": "^0.24.0", 23 15 "terser": "^5.31.6", 24 16 "wrangler": "^4.54.0" 25 - } 17 + }, 18 + "packageManager": "pnpm@10.10.0" 26 19 }